Last Comment Bug 492620 - (tb-logging) better, easier logging/diagnostics for Thunderbird [meta]
(tb-logging)
: better, easier logging/diagnostics for Thunderbird [meta]
Status: NEW
: meta
Product: Thunderbird
Classification: Client Software
Component: General (show other bugs)
: Trunk
: x86 Windows XP
: -- enhancement (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
:
Mentors:
Depends on: 47864 103865 174839 182459 182481 229173 286723 386218 408618 480841 518768 540763 609675 643796 669212 697522 122213 125825 257810 450631 Log.jsm 480843 1075149
Blocks: 35435
  Show dependency treegraph
 
Reported: 2009-05-12 12:18 PDT by Wayne Mery (:wsmwk, NI for questions)
Modified: 2016-02-04 03:38 PST (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Wayne Mery (:wsmwk, NI for questions) 2009-05-12 12:18:16 PDT
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
Comment 1 Mark Banner (:standard8) 2009-05-12 12:28:29 PDT
(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.
Comment 2 Joshua Cranmer [:jcranmer] 2010-08-28 13:49:37 PDT
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...
Comment 3 Wayne Mery (:wsmwk, NI for questions) 2012-04-06 00:20:02 PDT
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
Comment 4 Wayne Mery (:wsmwk, NI for questions) 2016-01-08 19:34:12 PST
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
-

Note You need to log in before you can comment on or make changes to this bug.