0.3.0 • Published 6 years ago

hubiquitus-logger-mongo v0.3.0

Weekly downloads
30
License
-
Repository
github
Last release
6 years ago

Hubiquitus logger mongo

This module overrides the log method of hubiquitus to persist logs into database.

Installation

$ npm install hubiquitus-logger-mongo

How to use

var hubiquitus = require('hubiquitus-core');
var mongoLogger = require('hubiquitus-logger-mongo');

var logger = hubiquitus.logger('sample');
hubiquitus.logger.enable('sample', 'info');

mongoLogger.configure({dbname: 'test', collection: 'hlog'}, function (err) {
  if (err) return logger.err(err);
  logger.info('OK !');
});

The configure method takes a configuration object. That object may contains :

  • host {String} mongo host; default is '127.0.0.1'
  • port {Number} mongo port; default is mongo.Connection.DEFAULT_PORT
  • dbname {String} mongo database; default is 'hubiquitus'
  • collection {String} mongo collection; default is 'logs'
  • username {String} mongo username; default does not use authentication
  • password {String} mongo password; default does not use authentication
0.3.0

6 years ago

0.1.4

7 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago