Firefox Addon console.log() Not working

You can use Firebug for your firefox extension development. If you install this add-on, you can use its console with "Firebug.Console.log();" command. Please be careful, in this command you should not type "Console" with a small letter!

In addition, you can use Firefox "Browser Console" (not Web Console) by the following command: Application.console.log();


If you are working on an extension/addon (not SDK), simply import the Console.jsm and then the console.log() will work normally. That is what I do.

Components.utils.import('resource://gre/modules/devtools/Console.jsm');

Update: As of Firefox 44+

Components.utils.import('resource://gre/modules/Console.jsm');

By default the minimum log level is error. Everything else is not printed, and that includes console.log(). Please see the Log Levels for more information on how to use and configure logging and associated levels.


Using the Addon SDK? You must set the Log level for your extension:

var self = require("sdk/self"); 
var prefService = require("sdk/preferences/service");  
prefService.set('extensions.'+ self.id +'.sdk.console.logLevel','all');