A little MongoDB plugin for loggin-js, save your logs centralized in a database. And later retrieval
With npm
npm install loggin-js-mongodb
With yarn
yarn install loggin-js-mongodb
Importing in node:
const logginMongo = require('loggin-js-mongodb');
Importing using ES6 import:
import logginMongo from 'loggin-js-mongodb';
const logginMongo = require('loggin-js-mongodb');
loggin.use(logginMongo);
let mongodb = loggin
.notifier('mongodb', { dbUrl: 'mongodb://0.0.0.0:27017/logs' })
.color(true)
.level('debug')
.formatter('detailed')
.init();
let logger = loggin.logger();
logger.setNotifiers([csol, mongodb]);
...
let logs = mongodb.fetch({ 'level.name': 'ERROR' });
Pull requests are welcome, as well as any other type of contribution.
# clone the repo
$ git clone git@github.com:nombrekeff/loggin-js-mongodb.git
# enter the project
$ cd loggin-js-mongodb
# install dependencies
$ npm install
# run tests
$ npm test