mini-rest-logger
v0.0.33
Published
Winston-based logger for mini-rest project with console, file, winlog (win32 only) transports
Downloads
9
Maintainers
Readme
mini-rest-logger
Winston-based logger for mini-rest project with console, file, winlog (win32 only) transports
If you have different needs regarding the functionality, please add a feature request.
Installation
npm install --save mini-rest-logger
Usage
Simple
var logger1 = require('../')({});
logger1.silly('silly');
logger1.debug('debug');
logger1.info('info');
logger1.warn('warn');
logger1.error('error');
Advanced
var logger2 = require('../')('logger2', {
"console_level": "silly",
"winlog_level": "info",
"winlog_source": "awl-client",
"file_level": "debug",
"filename": __dirname+"/log/app.log",
"maxsize": 1000000,
"maxFiles": 10,
"instantiateLimit": 10, // change instantiation warning limit
}
);
logger2.silly('silly');
logger2.debug('debug');
logger2.info('info');
logger2.warn('warn');
logger2.error('error');
$ node examples/example.js
2016-03-06T21:13:00.035Z - info: [index] info
2016-03-06T21:13:00.038Z - warn: [index] warn
2016-03-06T21:13:00.039Z - error: [index] error
2016-03-06T21:13:00.041Z - silly: [logger2] silly
2016-03-06T21:13:00.041Z - debug: [logger2] debug
2016-03-06T21:13:00.041Z - info: [logger2] info
2016-03-06T21:13:00.041Z - warn: [logger2] warn
2016-03-06T21:13:00.042Z - error: [logger2] error
Credits
Links to package pages:
github.com npmjs.com travis-ci.org coveralls.io inch-ci.org
License
MIT