Skip to content

Instantly share code, notes, and snippets.

Created March 1, 2011 23:18
Show Gist options
  • Save anonymous/850104 to your computer and use it in GitHub Desktop.
Save anonymous/850104 to your computer and use it in GitHub Desktop.
a wrapper module that I'm using to abstract the logger for use in other modules
// Require necessary modules
var path = require('path');
var log4js = require('log4js')();
// Define variables with module scope
var configPath = path.join( process.env.USWDSS_BWMCI_HOME, 'config');
var logConfigFile = path.join(configPath, 'log4js.json');
exports.getLogger = function (category) {
log4js.configure(logConfigFile);
return log4js.getLogger(category);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment