MailNews:Logging: Difference between revisions

Jump to navigation Jump to search
m
improve linux and other clarifications
m (→‎Thunderbird Logging Types: clarify imap.loglevel not available in v115)
m (improve linux and other clarifications)
Line 7: Line 7:
== Introduction ==
== Introduction ==


Logging in recent years has evolved in:
Logging in recent years has evolved regarding:
* where logging is enabled - possibilities include command line, and Thunderbird preferences
* how logging is enabled - possibilities include command line (original method), and Thunderbird preferences (newer method)
* location of log data - possibilities include logging to a file, and logging to the Error Console
* location of log data - possibilities include logging to a file (original method), and logging to the Error Console (alternative method)


Also, we have two types of logging:
Also, we have two types of logging:
* [[MailNews:Logging#Thunderbird_Logging|Thunderbird logging]], for calendar, chat, gloda indexing and seach, ldap, nntp (news), pop, and smtp (sending mail)
* [[MailNews:Logging#Thunderbird_Logging|Thunderbird logging]], for calendar, chat, gloda indexing and search, ldap, nntp (news), pop, and smtp (sending mail)
* [[MailNews:Logging#gecko_logging|Gecko logging]], which uses case senstive [[MailNews:Logging#Thunderbird_Module_Names|module names]], such as IMAP and IMAPAutoSync
* [[MailNews:Logging#gecko_logging|Gecko logging]], which uses case sensitive [[MailNews:Logging#Thunderbird_Module_Names|module names]], such as IMAP and IMAPAutoSync


== Thunderbird Logging ==
== Thunderbird Logging ==


Modern logging is specified by [[MailNews:Logging#Setting_a_Preference|setting a preference]] in Thunderbird.  
This is the modern method, where logging is specified by [[MailNews:Logging#Setting_a_Preference|setting a preference]] in Thunderbird.  


Unless otherwise specified, logging output goes to the Error Console, at Tools > Developer > Error Console or use the hotkey Control+Shift+J (Command+Shift+J on macOS).
Unless otherwise specified, logging output goes to the Error Console, at Tools > Developer > Error Console or use the hotkey Control+Shift+J (Command+Shift+J on macOS).
Line 35: Line 35:
* 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]
* imap - <code>mailnews.imap.loglevel</code> string, set to <code>All</code> ('''only if you have set mailnews.imap.jsmodule=true, Daily channel builds only - not available in version 115''')
* imap (not available in version 115) - <code>mailnews.imap.loglevel</code> string, set to <code>All</code>, but only if you have set mailnews.imap.jsmodule=true for Beta and Daily channel builds only.
* ldap - <code>mailnews.ldap.loglevel</code>, string, set to <code>All</code>
* ldap - <code>mailnews.ldap.loglevel</code>, string, set to <code>All</code>
* NNTP - <code>mailnews.nntp.loglevel</code>, string,  set to <code>All</code>
* NNTP - <code>mailnews.nntp.loglevel</code>, string,  set to <code>All</code>
Line 64: Line 64:
== Gecko Logging ==
== Gecko Logging ==


Gecko logging using module names is the classic method of getting log data. Gecko logging may be enabled via preferences (not discussed in this document), or command line, which is discussed here.  
Gecko logging using module names is the classic method of getting log data. Gecko logging may be enabled via preferences (not discussed in this document), or command line, which is discussed below.  


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], including [https://searchfox.org/mozilla-central/search?q=LazyLogModule+.*%5C%28%22&path=&case=true&regexp=true module names].  
Thunderbird gets its module logging capabilities from Firefox core, also known as Gecko. Gecko logging capabilities are thoroughly documented in this [https://firefox-source-docs.mozilla.org/xpcom/logging.html excellent reference], including [https://searchfox.org/mozilla-central/search?q=LazyLogModule+.*%5C%28%22&path=&case=true&regexp=true module names].  


=== Thunderbird Module Names ===
=== Thunderbird Module Names ===
Line 139: Line 139:
* Optional special strings (switches) to configure the logging behaviour. Some configuration switches take an integer parameter, in which case the integer is separated from the string by a colon (:). Most switches only apply in a specific output context. Full documentation at [https://firefox-source-docs.mozilla.org/xpcom/logging.html#the-moz-log-syntax].
* Optional special strings (switches) to configure the logging behaviour. Some configuration switches take an integer parameter, in which case the integer is separated from the string by a colon (:). Most switches only apply in a specific output context. Full documentation at [https://firefox-source-docs.mozilla.org/xpcom/logging.html#the-moz-log-syntax].


Example module and loglevel: '''IMAP:4,IMAPAutoSync:5,timestamp'''
Example module and loglevel: '''"IMAP:4,IMAPAutoSync:5,timestamp"'''


''',timestamp''' adds a timestamp to all log lines - generally recommended, and required for all timeouts and issues which need to be correlated to an action at a given time of day  
''',timestamp''' adds a timestamp to all log lines - generally recommended, and required for all timeouts and issues which need to be correlated to an action at a given time of day  
Line 210: Line 210:
==== Linux/unix ====
==== Linux/unix ====


To generate a log, run the following commands before running the application from the command line:
Variables set for MOZ_LOG and MOZ_LOG_file must be specified in quotation marks. MOZ_LOG_FILE must be fully specified without shortcuts, such as "~/". Run the following commands before running the application from the command line:


  # For bash shell (the default shell on most GNU/Linux systems):
  # For bash shell (the default shell on most GNU/Linux systems):
  export MOZ_LOG=moduleName:5,timestamp
  export MOZ_LOG="moduleName:5,timestamp"
  export MOZ_LOG_FILE=/tmp/log_file
  export MOZ_LOG_FILE="/tmp/log_file"


  # For tcsh / csh (which is not as common):
  # For tcsh / csh (which is not as common):
Line 223: Line 223:


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 use [[MailNews:Logging#Thunderbird_Logging|Thunderbird logging]], not Gecko module logging using environment variables.
* If logging ldap, nntp, pop3, or smtp, you '''must''' use [[MailNews:Logging#Thunderbird_Logging|Thunderbird logging]], not Gecko module logging using environment variables.
* If logging imap, you '''must''' use [[MailNews:Logging#Gecko_Logging|Gecko module logging]] using environment variables.
* If linux, variables MOZ_LOG and MOZ_LOG_file must be in quotation marks.
* If linux, MOZ_LOG_file must be fully specified without shortcuts, such as "~/"
* 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 application?  (the log file is buffered in memory until the application is closed)
* Did you shut down the application?  (the log file is buffered in memory until the application is closed)
canmove, Confirmed users
2,081

edits

Navigation menu