MailNews:Logging: Difference between revisions

m
remove quotes, small cleanup
(→‎Environment Variables to set: better explain "sync")
m (remove quotes, small cleanup)
Line 1: Line 1:
<small>[[MailNews:Home Page|<< Back to MailNews:Home Page]]</small>
<small>[[MailNews:Home Page|<< Back to MailNews:Home Page]]</small>


Mailnews logs provide data which may help developers and triagers understand what is causing an issue. Please enable Thunderbird to write extra information to a log file, by setting two environment variables before running a MailNews application.
Mailnews logs provide data to help developers and triagers understand what is causing an issue. Please enable Thunderbird to write extra information to a log file, by setting two environment variables before running a MailNews application.


__TOC__
__TOC__
== Logging prior to Thunderbird 55.0a1 / SeaMonkey 2.52a1 ==
Around April 5, 2017, via {{bug|1222244}} and blockers of {{bug|1219461}}, changes were merged to the Mozilla trunk which impacted logging functionality. Prior to these changes, the variable names used to configure logging were '''NSPR_LOG_MODULES''' and '''NSPR_LOG_FILE''' rather than '''MOZ_LOG''' and '''MOZ_LOG_FILE'''. If you are working with an older version, use the old variable names.
In addition, some log module names changed. The old names are documented below, but will eventually be removed (along with this section) when enough time has past that it is no longer necessary for most people to debug older versions of the applications. Of course, the obsolete documentation will remain accessible in the history of this page.
Note that log module names are '''CASE SENSITIVE'''.


== Main module options within MailNews ==
== Main module options within MailNews ==
Line 38: Line 30:
== Environment Variables to set ==
== Environment Variables to set ==


Two variables must be set - you choose how to set it up. You can set them globally as system environment variables (find instructions for your OS), or as local environment variables in a batch file/script (described [[MailNews:Logging#Generating_a_Protocol_Log|below]]), or just on the command line.
Two variables must be set. You can set them globally as system environment variables (find instructions for your OS), or as local environment variables in a batch file/script (described [[MailNews:Logging#Generating_a_Protocol_Log|below]]), or just on the command line.


# '''MOZ_LOG''' - '''CASE SENSITIVE''' module name and [[MailNews:Logging#Logging_level|log level]] separated by colon, multiple modules separated by comma, and additional options:
# '''MOZ_LOG''' - '''CASE SENSITIVE''' module name and [[MailNews:Logging#Logging_level|log level]] separated by colon, multiple modules separated by comma, and additional options:
#* Example module and loglevel with timestamp: "POP3:5,SMTP:3,timestamp"
#* Example module and loglevel: '''POP3:5,SMTP:3,timestamp'''
#* Example module and loglevel: "IMAP:5,timestamp"
#* Example module and loglevel: '''IMAP:5,timestamp'''
#* optional, recommended '''",timestamp"''' : a timestamp string is added to all log entries - required for all timeouts and issues which need to be correlated to an action at a given time of day <small>(as of 2009-05-13 3.0b3pre builds)</small>
#* ''',timestamp''' adds a timestamp to all log lines - generally recommended. required for all timeouts and issues which need to be correlated to an action at a given time of day <small>(as of 2009-05-13 3.0b3pre builds)</small>
#* optional, not recommended (because it makes logging slower and affects your performance) ",sync" : Buffering in log writing is disabled that  so latest log data can be seen by tailing or copying the log file.
#* optional, not recommended (because it makes logging slower and affects your performance) ''',sync''' : Buffering in log writing is disabled that  so latest log data can be seen by tailing or copying the log file.
# '''MOZ_LOG_FILE''' - Path (with name) to the log file
# '''MOZ_LOG_FILE''' - Path (with name) to the log file
#* If MOZ_LOG_FILE is not set, then the output will be logged to the console where the application was launched.
#* If MOZ_LOG_FILE is not set, then the output will be logged to the console where the application was launched.
Line 51: Line 43:
Note:  
Note:  
* The log file is written over every time you re-launch the Mozilla application.
* The log file is written over every time you re-launch the Mozilla application.
* If you are running multiple Mozilla applications (Firefox and Thunderbird) they may stomp on each other in the log, or even wipe out the others log entries.
* You must have write access to the directory of the log file.
* You must have write access to the directory of the log file.


Line 70: Line 63:
=== Windows ===
=== Windows ===


Create a batch file by copying the lines below and paste them into the notepad application, and save the file as "create_imap_log.bat".  Variables must not contain quotation marks.
Create a batch file by copying the lines below and paste them into the notepad application, and save the file as "create_imap_log.bat".  Variables MOZ_LOG and MOZ_LOG_file must not contain quotation marks.


  set MOZ_LOG=IMAP:5,timestamp
  set MOZ_LOG=IMAP:5,timestamp
Line 131: Line 124:


If your log file is empty or missing, review this document again, and check for these common problems:
If your log file is empty or missing, review this document again, and check for these common problems:
* Do you have write access to the directory specified?
* Do you have write access to the directory specified in MOZ_LOG_FILE?
* Did you shut down the mailnews application?  (the log file is buffered in memory)
* Did you shut down the mailnews application?  (the log file is buffered in memory)
* Did you restart your mailnews application, and wipe out the log of the session you wanted to debug?  (every restart wipes out the previous log)
* Did you restart your mailnews application, and wipe out the log of the session you wanted to debug?  (every restart wipes out the previous log)
Line 194: Line 187:
* {{Bug|193873}} - Add Mozilla logging to UI / [[Thunderbird:Logging_UI]]
* {{Bug|193873}} - Add Mozilla logging to UI / [[Thunderbird:Logging_UI]]
* {{Bug|697522}} - precise logging of message filter runs and actions
* {{Bug|697522}} - precise logging of message filter runs and actions
== Logging prior to Thunderbird 55.0a1 / SeaMonkey 2.52a1 ==
Around April 5, 2017, via {{bug|1222244}} and blockers of {{bug|1219461}}, changes were merged to the Mozilla trunk which impacted logging functionality. Prior to these changes, the variable names used to configure logging were '''NSPR_LOG_MODULES''' and '''NSPR_LOG_FILE''' rather than '''MOZ_LOG''' and '''MOZ_LOG_FILE'''. If you are working with an older version, use the old variable names.
In addition, some log module names changed. The old names are documented below, but will eventually be removed (along with this section) when enough time has past that it is no longer necessary for most people to debug older versions of the applications. Of course, the obsolete documentation will remain accessible in the history of this page.
Note that log module names are '''CASE SENSITIVE'''.
canmove, Confirmed users
2,190

edits