Name: winston-mongodb
Owner: winstonjs
Description: A MongoDB for winston
Created: 2011-06-07 08:03:46.0
Updated: 2018-01-16 03:50:07.0
Pushed: 2017-12-09 10:12:57.0
Homepage: http://github.com/indexzero/winston-mongodb
Size: 137
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
A MongoDB transport for winston.
Current version supports only mongodb driver version 2.x. If you want to use winston-mongodb with mongodb version 1.4.x use winston-mongodb <1.x.
tldr;?
: To break the winston codebase into small modules that work
together.
The winston codebase has been growing significantly with contributions and
other logging transports. This is awesome. However, taking a ton of
additional dependencies just to do something simple like logging to the Console
and a File is overkill.
r winston = require('winston');
*
Requiring `winston-mongodb` will expose
`winston.transports.MongoDB`
/
quire('winston-mongodb');
nston.add(winston.transports.MongoDB, options);
The MongoDB transport takes the following options. 'db' is required:
{poolSize: 2, autoReconnect: true}
).Metadata: Logged as a native JSON object in 'meta' property.
Logging unhandled exceptions: For logging unhandled exceptions specify
winston-mongodb as handleExceptions
logger according to winston documentation.
Besides supporting the main options from winston, this transport supports the following extra options:
_id
attribute
settled by mongodb, defaults to false
.npm install winston
npm install winston-mongodb