Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.6 KB

File metadata and controls

45 lines (31 loc) · 1.6 KB

Izaya

A logging library which writes to a mongoDB instance

Getting Started

Setup

Require the library and initialize it. The most basic setup takes only a MongoDB connection string as described here

var Log = require('izaya');

Log.init({
	url        : 'http://localhost:27017/MyDatabase'
});

This will cause a collection by the default name of logs to be created the first time a write is performed.

Writing logs

There multiple logging functions available right off the bat, and more can be added dynamically. The most basic log content which can be provided is a string. An informative log might take advantage of the standard log level info

Log.info('something normal happened');

while we have the escalated warn and error levels for less acceptable behavior

Log.warn('something concerning happened');
Log.error('something bad happened');

Changelog

0.0.2

  • changed created metadata field to a true date object so it can be queried

This documentation is still in progress...