winstonjs/winston-mongodb

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

winston

Gitter

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.

Motivation

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.

Usage
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:

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.

Querying and streaming logs

Besides supporting the main options from winston, this transport supports the following extra options:

Installation
npm install winston
npm install winston-mongodb
Changelog
Author: Charlie Robbins Contributors: Yurij Mikhalevich, Kendrick Taylor, Yosef Dinerstein, Steve Dalby

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.