Bug 492620 (tb-logging)

better, easier logging/diagnostics for Thunderbird [meta]

NEW
Unassigned

Status

Thunderbird
General
--
enhancement
8 years ago
a year ago

People

(Reporter: wsmwk, Unassigned)

Tracking

(Depends on: 16 bugs, Blocks: 1 bug, {meta})

Trunk
x86
Windows XP
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

better, easier logging/diagnostics for Thunderbird

starting list:
bug 450631 We should include log4moz as a JS module for front-end and extension work
bug 451283 Adding log4moz.js to toolkit 
Bug 103865 Improve [filter] Logging - add archive capability
Bug 386218 make debug/trace logging circular and automatic
Bug 229173 Better access to POP3/SMTP logging
bug 174839 Improve Filter log display format 
bug 182481 Message Filter Log should have a search button 
bug 286723 need import error log file 
bug 47864 Include server response in NNTP logging 
bug 182459 include port number in "SMTP Connecting" log message 
Bug 311632 Get LDAP change log replication working again.

based loosely on 
https://bugzilla.mozilla.org/buglist.cgi?query_format=advanced&product=MailNews+Core&product=Thunderbird&resolution=---&chfieldto=Now&field0-0-0=short_desc&type0-0-0=nowordssubstr&value0-0-0=dialog&field1-0-0=short_desc&type1-0-0=anywords&value1-0-0=log+logs+logging&field1-0-1=short_desc&type1-0-1=substring&value1-0-1=diag
(In reply to comment #0)
> Bug 311632 Get LDAP change log replication working again.

Nothing to do with this bug - its a LDAP method of replication.
No longer depends on: 311632
For what it's worth, with jsctypes and some clever abuse of API, you can dynamically enable logging with the UI. Unfortunately, it all goes to one file, and NSPR doesn't log which module is logging, so you can't separate log files.

Here is the code I used:
Components.utils.import("resource://gre/modules/ctypes.jsm");

var nspr = ctypes.open("libnspr4.so");
var prlog = ctypes.StructType("PRLogModuleInfo");
prlog.define(
    [{"name": ctypes.char.ptr},
     {"level": ctypes.int},
     {"next": prlog.ptr}]);
var func = nspr.declare("PR_NewLogModule",
    ctypes.default_abi,
    prlog.ptr,
    ctypes.char.ptr);
var setLog = nspr.declare("PR_SetLogFile",
    ctypes.default_abi,
    ctypes.int,
    ctypes.char.ptr);

setLog("/tmp/foo.log");
var lm = func("");

while (!lm.isNull()) {
  if (lm.contents.name.readString() == 'nsSocketTransport')
    lm.contents.level = 5;
  lm = lm.contents.next;
}
nspr.close();

And, lo and behold, FF started logging nsSocketTransport to /tmp/foo.log! This does require a version of ctypes with structure support, which 1.9.2 does NOT have.

I'm not sure which bug is actually asking for UI for logging, but if anyone wanted to hack a control up for trunk TB, this should be doable...
(Reporter)

Updated

6 years ago
Depends on: 480843
(Reporter)

Updated

6 years ago
Depends on: 480841
(Reporter)

Updated

6 years ago
Depends on: 643796
(Reporter)

Updated

6 years ago
Depends on: 122213

Updated

6 years ago
Depends on: 697522

Updated

6 years ago
Blocks: 35435
references:
* https://wiki.mozilla.org/MailNews:Logging
* https://addons.mozilla.org/en-US/thunderbird/addon/loghelper/
* https://addons.mozilla.org/en-US/thunderbird/addon/tbtracer/

additions:
bug 540763 - Add logging to imap retry code.
Bug 669212 - SMTP Log does not contain body of email 
Bug 518768 - Rationalize autosync logging
Bug 257810 - RFE Way of dynamically turning on and off pr logging (duped to bug 237326)
Bug 609675 - output version information to nspr log on Thunderbird startup or start of logging
Alias: tb-logging
Depends on: 669212, 540763, 518768, 257810, 609675
Summary: better, easier logging/diagnostics for Thunderbird → better, easier logging/diagnostics for Thunderbird [meta]
(Reporter)

Updated

5 years ago
Depends on: 125825
(Reporter)

Updated

3 years ago
Depends on: 408618
(Reporter)

Updated

3 years ago
Depends on: 1075149
n.b. 
- bug 1233881 landed for gecko 46 -  Support dynamically setting log levels at runtime via prefs 
- Bug 881389 - (OneLogger) Improve Gecko's logging story'
- Bug 1174785 - Add a LogModule replacement for PRLogModuleInfo
- Bug 1174972 - Switch out mozilla logging backend
-
You need to log in before you can comment on or make changes to this bug.