node-bunyan-lite/examples/ringbuffer.js

15 lines
381 B
JavaScript
Raw Permalink Normal View History

/* Create a ring buffer that stores the last 100 records. */
2012-06-19 21:36:02 +00:00
var bunyan = require('..');
var ringbuffer = new bunyan.RingBuffer({ limit: 100 });
var log = new bunyan({
2013-03-29 00:42:32 +00:00
name: 'foo',
streams: [ {
type: 'raw',
stream: ringbuffer,
level: 'debug'
} ]
2012-06-19 21:36:02 +00:00
});
log.info('hello world');
console.log(ringbuffer.records);