canmove, Confirmed users
2,230
edits
(remove obsolete tools, better references to current Gecko logging capabilities, misc fixes) |
(Major reorganization (step 1) to focus on modern logging methods, add chat logging levels) |
||
| Line 1: | Line 1: | ||
<small>[[MailNews:Home Page|<< Back to MailNews:Home Page]]</small> | <small>[[MailNews:Home Page|<< Back to MailNews:Home Page]]</small> | ||
Logs provide data to help developers and triagers understand what is causing an issue. Please provide a log file when requested. If you have difficulty or questions, please ask for help. | |||
__TOC__ | __TOC__ | ||
== | == Introduction == | ||
MailNews | Logging in recent years has evolved in: | ||
* how logging is enabled, via command line or during run time in preferences | |||
* location of log data, either to a file, or to the Error Console | |||
Futher, logging is possible via: | |||
* [[[[MailNews:Logging#gecko_logging|Gecko logging]], which uses [[MailNews:Logging#Thunderibrd_Module_names|module names]] | |||
* [[MailNews:Logging#Thunderbird_logging|Thunderbird logging]] | |||
Thunderbird specific logging is enabled only via preferences. Gecko logging is enabled via preferences or command line. For simplicity, we will not over all possible combinations in this document. | |||
== Thunderbird Logging == | |||
Thunderbird logging is disabled by default. Unless otherwise specified, logging is enabled by [[MailNews:Logging#setting_a_preference|setting a preference]] to <code>true</code>. Unless otherwise specified, logging output goes to the Error Console, accessible at Tools > Developer > Error Console. | |||
=== Thunderbird Logging Types === | |||
* [[Calendar:QA_CalDAV_Support#Diagnosis_hints|Calendar/Calendar logging]] | |||
* Chat - <code>purple.debug.loglevel</code> set to [https://hg.mozilla.org/comm-central/file/tip/chat/chat-prefs.js#l94] | |||
** 0 Show all libpurple messages (PURPLE_DEBUG_ALL) | |||
** 1 Very verbose (PURPLE_DEBUG_MISC) | |||
** 2 Verbose (PURPLE_DEBUG_INFO) | |||
** 3 Show warnings (PURPLE_DEBUG_WARNING) | |||
** 4 Show errors (PURPLE_DEBUG_ERROR) | |||
** 5 Show only fatal errors (PURPLE_DEBUG_FATAL) | |||
* Chat Off-The-Record (OTR) protocol for exchanging encrypted chat messages - <code>chat.otr.trace</code> boolean preference | |||
* [https://wiki.mozilla.org/Thunderbird:Debugging_Gloda Gloda Indexing (global search) activity to Error Console] | |||
=== Setting a Preference === | |||
To configure logging via a Thunderbird Preference, you must create a hidden Thunderbird preference, not an environment variable. In Thunderbird do: | |||
# Settings > General | |||
# in the search field type <code>config editor</code> | |||
# click Config Editor | |||
# in the search field paste or type the preference name, for example mailnews.pop3.loglevel | |||
# if you are presented with choices of Boolean, Number, String, choose Boolan for true or false settings, otherwise choose Number and click the <code>+</code> (plus sign) | |||
# change the preferences's value to the desired logging value | |||
#* for numeric preferences click the pencil icon, change the value, then click the check mark | |||
#* for boolean preferences click the double headed arror to switch between <code>true</code> and </code>false</code> | |||
To delete a preference, click the trash can. | |||
It is not necessary to restart Thunderbird - logging starts immediately. You can view the output in the Error Console. | |||
== Gecko Logging == | |||
Thunderbird gets its "module" logging capabilities from Firefox core aka Gecko. whose logging capabilities are documented at https://firefox-source-docs.mozilla.org/xpcom/logging.html. The many modules available are listed in [https://searchfox.org/mozilla-central/search?q=LazyLogModule+.*%5C%28%22&path=&case=true®exp=true this searchfox query]. Some examples: | |||
* nsHostResolver (for DNS) | |||
* GetAddrInfo (for DNS) | |||
* nsSocketTransport (basic networking) | |||
=== Thunderbird Module Names === | |||
All names are '''CASE SENSITIVE'''. Some relate to specific mail protocols. | |||
# BayesianFilter | # BayesianFilter | ||
| Line 26: | Line 78: | ||
# smtp - [[MailNews:Logging#Setting_Thunderbird_Preference|Set preference]] mailnews.smtp.loglevel to "All". Open the Error Console with Ctrl+Shift+J or Command+Shift+J, add timestamp [1], and copy log entries. (Prior to Thunderbird 91 use "smtp" module name.) | # smtp - [[MailNews:Logging#Setting_Thunderbird_Preference|Set preference]] mailnews.smtp.loglevel to "All". Open the Error Console with Ctrl+Shift+J or Command+Shift+J, add timestamp [1], and copy log entries. (Prior to Thunderbird 91 use "smtp" module name.) | ||
[1] To expose timestamp, click the gear icon in top-right of the Error Console, turn on "Show Timestamps" | Notes: | ||
* [[MailNews:Logging#Other_Protocol_Logging_options_within_MailNews|Additional module choices are listed below]]. | |||
* In version 59, {{bug|1353919}} changed these options to be mixed case. The old, inconsistent case options are in parenthesis. | |||
* [1] To expose timestamp in the Error Console, click the gear icon in top-right of the Error Console, turn on "Show Timestamps". | |||
=== Environment Variables to set === | |||
'''NOTE - do not use this section for ldap, nntp, pop3 and smtp. They are configured in Thunderbird Settings, and log to the Thunderbird Error Console.''' Please refer to [[MailNews:Logging#Module_options_within_MailNews|module options]]. | |||
'''NOTE - do not use this section for ldap, nntp, pop3 and smtp. They are configured in Thunderbird Settings, and log to the Thunderbird Error Console.''' Please refer to [[MailNews:Logging# | |||
Two variables must be set. (Except for logging of ldap, nntp, pop3 and smtp, which are configured in Thunderbird settings and log to the Error Console - per instructions above. So you may ignore this section and the next for these protocols.) You can set these variables 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. (Except for logging of ldap, nntp, pop3 and smtp, which are configured in Thunderbird settings and log to the Error Console - per instructions above. So you may ignore this section and the next for these protocols.) You can set these variables 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. | ||
| Line 129: | Line 182: | ||
To get a log for another protocol, replace "IMAP" with e.g. "MIME" in the above instructions. | To get a log for another protocol, replace "IMAP" with e.g. "MIME" in the above instructions. | ||
=== Missing Log File === | === Missing Log File === | ||
| Line 165: | Line 215: | ||
The full list of modules available are listed in [https://searchfox.org/comm-central/search?q=LazyLogModule+.*\(%22&path=&case=true®exp=true this searchfox query]. | The full list of modules available are listed in [https://searchfox.org/comm-central/search?q=LazyLogModule+.*\(%22&path=&case=true®exp=true this searchfox query]. | ||
== More NSPR Logging Options = | |||
== More NSPR Logging Options = | |||
Miscellaneous [http://www.mozilla.org/projects/nspr/reference/html/prlog.html NSPR Reference (logging)]. | Miscellaneous [http://www.mozilla.org/projects/nspr/reference/html/prlog.html NSPR Reference (logging)]. | ||