Thunderbird provides an Application interface that, among other things, helps with logging:
var {Cc, Ci} = require("chrome");
var Application = Cc["@mozilla.org/steel/application;1"]
.getService(Ci.steelIApplication);
Application.console.log('Bam!');