sven-piller / logService

Service for logging in nodejs projects
MIT License
1 stars 0 forks source link

node-logservice-db-file-console

Service for logging in nodejs projects

Build Status npm version Downloads/month dependencies Status devDependencies Status Coverage Status GitHub license GitHub issues Greenkeeper badge

Configurable to log via winston-mongodb to database, via winston to files and/or to console.

TODO

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

Example Output

Tests

npm test

Contributing

Feel free and contribute

Release History