0.0.2 • Published 6 years ago

izaya v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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...

0.0.2

6 years ago

0.0.1

7 years ago