canmove, Confirmed users
2,239
edits
(Major reorganization (step 1) to focus on modern logging methods, add chat logging levels) |
(Great reorg step 2 (mainly combine the two Thunderbird lists)) |
||
| Line 8: | Line 8: | ||
Logging in recent years has evolved in: | Logging in recent years has evolved in: | ||
* how logging is enabled | * how logging is enabled- possibilities include command line, and run time via Thunderbird preferences | ||
* location of log data | * location of log data - possibilities include a file, and Error Console | ||
Futher, logging | Futher, logging happens from one of two choices: | ||
* | * [[MailNews:Logging#gecko_logging|Gecko logging]], which uses [[MailNews:Logging#Thunderibrd_Module_names|module names]] | ||
* [[MailNews:Logging#Thunderbird_logging|Thunderbird logging]] | * [[MailNews:Logging#Thunderbird_logging|Thunderbird logging]] | ||
== Thunderbird Logging == | == 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. | Modern logging is specified via Thunderbird preferences and output goes to the Error Console. 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 === | === Thunderbird Logging Types === | ||
| Line 31: | Line 29: | ||
** 4 Show errors (PURPLE_DEBUG_ERROR) | ** 4 Show errors (PURPLE_DEBUG_ERROR) | ||
** 5 Show only fatal errors (PURPLE_DEBUG_FATAL) | ** 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 | * 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] | * [https://wiki.mozilla.org/Thunderbird:Debugging_Gloda Gloda Indexing (global search) activity to Error Console] | ||
* ldap - <code>mailnews.ldap.loglevel</code> set to <code>All</code> | |||
* NNTP - <code>mailnews.nntp.loglevel</code> set to <code>All</code> | |||
* pop3 - <code>mailnews.pop3.loglevel</code> set to <code>All</code> | |||
* smtp - <code>mailnews.smtp.loglevel</code> set to <code>All</code> | |||
=== Setting a Preference === | === Setting a Preference === | ||
To configure logging via a Thunderbird Preference, you must create a hidden Thunderbird preference, not an environment variable. In Thunderbird | To configure logging via a Thunderbird Preference, you must create a hidden Thunderbird preference, not an environment variable. In Thunderbird : | ||
# Settings > General | # do Settings > General | ||
# in the search field type <code>config editor</code> | # in the search field type <code>config editor</code> | ||
# click Config Editor | # click Config Editor | ||
| Line 44: | Line 46: | ||
# change the preferences's value to the desired logging value | # 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 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 < | #* 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. | To delete a preference, click the trash can. | ||
| Line 52: | Line 54: | ||
== Gecko Logging == | == Gecko Logging == | ||
Thunderbird gets its "module" logging capabilities from Firefox core aka Gecko. | Gecko logging is the classic method of getting log data. Gecko logging is enabled via preferences (not discussed in this document) or command line. | ||
Thunderbird gets its "module" logging capabilities from Firefox core aka Gecko. Gecko logging capabilities are thoroughly documented in this [https://firefox-source-docs.mozilla.org/xpcom/logging.html excellent reference]. | |||
=== Thunderbird Module Names === | === Thunderbird Module Names === | ||
| Line 61: | Line 62: | ||
All names are '''CASE SENSITIVE'''. Some relate to specific mail protocols. | All names are '''CASE SENSITIVE'''. Some relate to specific mail protocols. | ||
# AbOutlookDirectory (before Thunderbird version 59: nsAbOutlookDirectoryLog) | |||
# AbWinHelper (before Thunderbird version 59: nsAbWinHelperLog) | |||
# BayesianFilter | # BayesianFilter | ||
# CMS (for S/MIME) | |||
# Filters | # Filters | ||
# IMAP (more [[MailNews:Logging#Other_Protocol_Logging_options_within_MailNews|below]]) | # IMAP (more [[MailNews:Logging#Other_Protocol_Logging_options_within_MailNews|below]]) | ||
# IMAP_CS (for CONDSTORE) | |||
# IMAP_KW (for keyword (tag) processing) | |||
# IMAPAutoSync (before Thunderbird version 59: ImapAutoSync) | |||
# IMAPCache (for IMAP caching of messages in no-sync folders) | |||
# IMAPOffline (before Thunderbird version 59: IMAPOFFLINE) | # IMAPOffline (before Thunderbird version 59: IMAPOFFLINE) | ||
# ldap | # Import (before Thunderbird version 59: IMPORT) | ||
# ldap <small>(After Thunderbird 90 use [[MailNews:Logging#Thunderbird_logging|Thunderbird logging]])</small> | |||
# Mailbox (before Thunderbird version 59: MAILBOX) | # Mailbox (before Thunderbird version 59: MAILBOX) | ||
# MailDirStore | # MailDirStore | ||
# MAPI | |||
# MAPIAddressBook | |||
# MIME | # MIME | ||
# MsgBiff | # MsgBiff | ||
| Line 74: | Line 85: | ||
# MsgDB <small>(level 1=opens/closes, level 5 lists open db's on close, number of msg hdrs in use)</small> (before Thunderbird version 59: MSGDB) | # MsgDB <small>(level 1=opens/closes, level 5 lists open db's on close, number of msg hdrs in use)</small> (before Thunderbird version 59: MSGDB) | ||
# MsgPurge | # MsgPurge | ||
# NNTP | # NNTP <small>(After Thunderbird 95 use [[MailNews:Logging#Thunderbird_logging|Thunderbird logging]])</small> | ||
# pop3 | # pop3 <small>(After Thunderbird 98 use [[MailNews:Logging#Thunderbird_logging|Thunderbird logging]])</small> | ||
# smtp <small>(After Thunderbird 90 use "[[MailNews:Logging#Thunderbird_logging|Thunderbird logging]])</small> | |||
Notes: | Notes: | ||
* [ | * The above list is fairly complete. The full, current definitive list of modules is in [https://searchfox.org/comm-central/search?q=LazyLogModule+.*\(%22&path=&case=true®exp=true this searchfox query]. | ||
* In version 59, {{bug|1353919}} changed these options to be mixed case. The old, inconsistent case options are in parenthesis. | * Potentially useful core Gecko modules not listed above: nsHostResolver (for DNS), GetAddrInfo (for DNS), nsSocketTransport (basic networking), negotiateauth (authentication) | ||
* In version 59, {{bug|1353919}} changed these options to be mixed case. The old, inconsistent case options are shown above 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". | * [1] To expose timestamp in the Error Console, click the gear icon in top-right of the Error Console, turn on "Show Timestamps". | ||
* Deprecated: | |||
** Movemail | |||
** AbOutlookDirFactory (before Thunderbird version 59: nsAbOutlookDirFactoryLog) | |||
** WABAddressBook | |||
=== Environment Variables to set === | === Environment Variables to set === | ||
'''NOTE - do not use this section for ldap, nntp, pop3 and smtp. They are configured | '''NOTE - do not use this section for ldap, nntp, pop3 and smtp. They are configured per [[MailNews:Logging#Thunderbird_logging|Thunderbird 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 104: | Line 120: | ||
=== Logging level === | === Logging level === | ||
'''NOTE - do not use this section for ldap, nntp, pop3 and smtp. They are configured | '''NOTE - do not use this section for ldap, nntp, pop3 and smtp. They are configured per [[MailNews:Logging#Thunderbird_logging|Thunderbird logging]]. | ||
The number in MOZ_LOG specifies the level of logging to be used. A lower number reduces the amount of information being logged. Use "5" unless requested otherwise. | The number in MOZ_LOG specifies the level of logging to be used. A lower number reduces the amount of information being logged. Use "5" unless requested otherwise. | ||
| Line 145: | Line 161: | ||
#!/bin/sh | #!/bin/sh | ||
export MOZ_LOG=IMAP:5,timestamp | export MOZ_LOG=IMAP:5,timestamp | ||
export MOZ_LOG_FILE=$HOME/imap.log | export MOZ_LOG_FILE=$HOME/Desktop/imap.log | ||
/Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin & | /Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin & | ||
| Line 181: | Line 197: | ||
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 === | ||
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: | ||
* Are you logging ldap, nntp, pop3, or smtp? You must | * Are you logging ldap, nntp, pop3, or smtp? You must use [[MailNews:Logging#Thunderbird_logging|Thunderbird logging]], not an environment variable. | ||
* Do you have write access to the directory specified in MOZ_LOG_FILE? | * 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) | ||
| Line 194: | Line 209: | ||
* Are your log module names correctly '''CASE SENSITIVE'''? (meaning mixed case, or camel case which is not all upper case, nor all lower case) | * Are your log module names correctly '''CASE SENSITIVE'''? (meaning mixed case, or camel case which is not all upper case, nor all lower case) | ||
== | == NSPR Logging Options == | ||
Miscellaneous [http://www.mozilla.org/projects/nspr/reference/html/prlog.html NSPR Reference (logging)]. | NSPR also has logging. Miscellaneous [http://www.mozilla.org/projects/nspr/reference/html/prlog.html NSPR Reference (logging)]. | ||
== Enhancement Ideas == | == Enhancement Ideas == | ||