14 September 2011

Activate logging for Mozilla applications (Firefox, Sunbird, Thunderbird ...).

There is many applications using NSPR, including Mozilla ones (Firefox, Sunbird, Thunderbird ...).
NSPR provides a set of logging functions which can be activated with
two global variables: NSPR_LOG_MODULES and NSPR_LOG_FILE.
See NSPR Reference for further information.

For Mozilla Thunderbird specific information, see this KB.

It is not easy to find an exhaustive list of [NS]PR module name, this article is the more complete I've found.

For instance, if you want to log POP3 and SMTP warnings, you can define global variables:
export NSPR_LOG_MODULES="POP3:3,SMTP:3"
export NSPR_LOG_FILE="/tmp/nspr.log"

Be aware that some applications use level PR_LOG_ALWAYS for some logs, some whatever the level you define (but 0 for none), you will get those log.
For instance, we can see such instruction in Thunderbird source code.

You can specify any module you want to activate logging of any applications based on NSPR you use.

1 comment:

  1. Nice, I will try this.
    For Windows OS, It's different method > https://developer.mozilla.org/en/HTTP_Logging

    ReplyDelete

Thank you for your visit, let's share your point of view: