Firefox: Enable logging

Hi,

in some cases it may be necessary to log the http traffic of your browser. For example

  • Web developing
  • Or for forensic purposes when you want in detail logged which site you are visiting or from which site you are moved to other sites…

Mozilla Firefox  has the ability to do that. This behaviour is controled by 2 environtment varibales

NSPR_LOG_MODULES – determines what is logged and in which detail
NSPR_LOG_FILE – Defines the log file

I use these set of modules in debug level 3, but there are many more logging modules you can use.

  • nsHttp:3
  • nsHostResolver:3

which is a good compromise between detail depth and logfile size.

NSPR_LOG_MODULES=nsHttp:3,nsHostResolver:3

NSPR_LOG_FILE=C:\temp\firefox.log

How to set these variables?

Under Windows, add it to your profile. Open Control Panel, System, Advancend System Settings, Environment Variables.

Enable Firefox logging Windows
Enable Firefox logging Windows

Under linux append the variables to the .profile file in your home directory:

michael@debdev:~# echo export NSPR_LOG_MODULES=nsHttp:3,nsHostResolver:3 >> ~/.profile
michael@debdev:~# echo export NSPR_LOG_FILE=~/firefox.log >> ~/.profile

Logoff and logon again and check if they are set

michael@debdev:~# set |grep  NSPR
NSPR_LOG_FILE=/home/michael/firefox.log
NSPR_LOG_MODULES=nsHttp:3,nsHostResolver:3

Start Firefox and look if the were logfile created and whether the log level is sufficient for your requirements.

Michael

One thought on “Firefox: Enable logging”

  1. In linux this creates a new “firefox.log.child-#” every session and tab that is open and soon you have hundreds of firefox.log files in your home directory. How do I SHUT IT OFF!?

Leave a Reply