Add following entry to your package.json
in the dependencies
property
"dependencies": {
"loggerjs" : "0.0.x"
},
Use a Logger instance in a Node.js module
var LoggerJS = require('loggerjs'),
options = {
namespace : 'my.awesome.project',
status : true,
logLevel : LoggerJS.DEBUG,
logServerUrl : '<logging_service_url>',
tags : ['myproject', 'node', 'something']
},
logger = new LoggerJS.Logger(options);
please refer to the LoggerJS README for a full list of options.
please refer to the LoggerJS README for an up to date API description.
Activates writing log entries to files.
Parameter:
- path: absolute path to the logfile
Example:
// activates file logging
logger.useLogfile(<path>);
Enables logfile task.
Example:
// enables file logging
logger.enableLogfile();
Disables logfile task.
Example:
// disables file logging
logger.disableLogfile();