A standalone lite version of bunyan, a JSON logging library for node.js services, without dtrace or moment or any dependencies.
 
Go to file
Trent Mick fdb9114218 multiple streams support at different levels; add 'file' stream type 2012-01-30 14:28:02 -08:00
examples multiple streams support at different levels; add 'file' stream type 2012-01-30 14:28:02 -08:00
lib multiple streams support at different levels; add 'file' stream type 2012-01-30 14:28:02 -08:00
.gitignore multiple streams support at different levels; add 'file' stream type 2012-01-30 14:28:02 -08:00
README.md first stab. 'log.info(...)' 2012-01-29 22:26:47 -08:00
TODO.md multiple streams support at different levels; add 'file' stream type 2012-01-30 14:28:02 -08:00
package.json first stab. 'log.info(...)' 2012-01-29 22:26:47 -08:00

README.md

Bunyan -- a JSON Logger for node.js servers.

Server logs should be structured. JSON's a good format. Let's do that: a log record is one line of JSON.stringify'd output. Let's also specify some common names for the requisite and common fields for a log record (see below).

Also: log4j is way more than you need.

Usage

// hi.js
var Logger = require('bunyan');
var log = new Logger({facility: "myapp", level: "info"});
log.info("hi");

$ node hi.js
{"time":"2012-01-30T00:56:25.842Z","facility":"myapp","level":2,"message":"hi"}

$ node hi.js | bunyan  # CLI tool to filter/pretty-print JSON logs.
{
  "time": "2012-01-30T00:56:25.842Z",
  "facility": "myapp",
  "level": 2,
  "message": "hi"
}

Levels

fatal
error
warn
info
debug

TODO

Log Record Fields

TODO

License

MIT.