Changelog
0.10.0
[pull #24] Support for gzip'ed log files in the bunyan CLI (by github.com/mhart):
$ bunyan foo.log.gz
...
Changelog
0.9.0
[pull #16] Bullet proof the bunyan.stdSerializers
(by github.com/rlidwka).
[pull #15] The bunyan
CLI will now chronologically merge multiple log
streams when it is given multiple file arguments. (by github.com/davepacheco)
$ bunyan foo.log bar.log
... merged log records ...
[pull #15] A new bunyan.RingBuffer
stream class that is useful for
keeping the last N log messages in memory. This can be a fast way to keep
recent, and thus hopefully relevant, log messages. (by @dapsays,
github.com/davepacheco)
Potential uses: Live debugging if a running process could inspect those
messages. One could dump recent log messages at a finer log level than is
typically logged on
uncaughtException
.
var ringbuffer = new bunyan.RingBuffer({ limit: 100 });
var log = new bunyan({
name: 'foo',
streams: [{
type: 'raw',
stream: ringbuffer,
level: 'debug'
}]
});
log.info('hello world');
console.log(ringbuffer.records);
Add support for "raw" streams. This is a logging stream that is given raw log record objects instead of a JSON-stringified string.
function Collector() {
this.records = [];
}
Collector.prototype.write = function (rec) {
this.records.push(rec);
}
var log = new Logger({
name: 'mylog',
streams: [{
type: 'raw',
stream: new Collector()
}]
});
See "examples/raw-stream.js". I expect raw streams to be useful for piping Bunyan logging to separate services (e.g. http://www.loggly.com/, https://github.com/etsy/statsd) or to separate in-process handling.
Add test/corpus/*.log files (accidentally excluded) so the test suite actually works(!).
Changelog
0.8.0
[pull #21] Bunyan loggers now re-emit fs.createWriteStream
error events.
By github.com/EvanOxfeld. See "examples/handle-fs-error.js" and
"test/error-event.js" for details.
var log = new Logger({name: 'mylog', streams: [{path: FILENAME}]});
log.on('error', function (err, stream) {
// Handle error writing to or creating FILENAME.
});
jsstyle'ing (via make check
)
Changelog
0.7.0
bunyan.createLogger(OPTIONS)
form, as is more typical in
node.js APIs. This'll eventually become the preferred form.Changelog
0.6.9
Change bunyan
CLI default output to color "src" info red. Before the "src"
information was uncolored. The "src" info is the filename, line number and
function name resulting from using src: true
in Logger
creation. I.e.,
the (/Users/trentm/tm/node-bunyan/examples/hi.js:10)
in:
[2012-04-10T22:28:58.237Z] INFO: myapp/39339 on banana.local (/Users/trentm/tm/node-bunyan/examples/hi.js:10): hi
Tweak bunyan
CLI default output to still show an "err" field if it doesn't
have a "stack" attribute.
Changelog
0.6.8
log.child({...}, true);
where the added child fields would
be added to the parent's fields. This bug only existed for the "fast child"
path (that second true
argument). A side-effect of fixing this is that
the "fast child" path is only 5 times as fast as the regular log.child
,
instead of 10 times faster.Changelog
0.6.6
bunyan
CLI taking log file path args, bunyan foo.log
,
in addition to the usual cat foo.log | bunyan
.bunyan
CLI.
Before it could blow up processing log records missing some expected
fields.Changelog
0.6.5
bunyan
CLI tool (for the default output mode/style).
Also add the '--color' option to force coloring if the output stream is not
a TTY, e.g. cat my.log | bunyan --color | less -R
. Use --no-color
to
disable coloring, e.g. if your terminal doesn't support ANSI codes.