node-logservice-db-file-console
v0.3.4
Published
Creates a winston logger and additional logging colorized in the console if in development environnment.
Downloads
3
Readme
node-logservice-db-file-console
Service for logging in nodejs projects
Configurable to log via winston-mongodb to database, via winston to files and/or to console.
TODO
- [x] Integrate base console logging
- [x] Integrate base file logging
- [ ] Integrate base mongodb logging
- [ ] Implement custom configuration
- [ ] Write tests
- [ ] Write documentation
Install
npm install node-logservice-db-file-console --save
Usage
var log = require('node-logservice-db-file-console')(configObject);
// change custom config globally in project
log.reinit(configObject);
// log events
log.logConsole('debug text message', 'debug', '[TEST]', 'client');
log.logConsole('info text message', 'info', '[TEST]', 'client');
log.logConsole('warn text message', 'warn', '[TEST]', 'client');
log.logConsole('error text message', 'error', '[TEST]', 'client');
log.logConsole('exception text message', 'exception', '[TEST]', 'client');
log.debug('debug text message', '[TEST]', 'client');
log.info('info text message', '[TEST]', 'client');
log.warn('warn text message', '[TEST]', 'client');
log.error('error text message', '[TEST]', 'client');
log.exception('exception text message', '[TEST]', 'client');
Example Output
Tests
npm test
Contributing
Feel free and contribute
Release History
- 0.3.4 Updated Readme and Dependencies
- 0.3.3 Updated Readme and Dependencies
- 0.3.0 File logging
- 0.2.0 Console logging
- 0.0.1 Initial release