Bunyan writing only info messages to stdout/stderr

385 views
Skip to first unread message

Howard Dierking

unread,
Oct 23, 2014, 12:58:39 PM10/23/14
to bunyan-...@googlegroups.com
I'm currently crafting our logging strategy and am looking at bunyan for it's use of JSON as a primary format. More generally, my thinking is that we'll output everything to stdio and then use redirection to route logs accordingly, thereby keeping this logic (or even code configuration) out of my applications.

While bunyan seems really promising from the examples, I'm running into an immediate problem in that no matter how I configure the logger, it still seems to be writing only info messages to stdout. As you can see from https://gist.github.com/howarddierking/7f0dac11809e571651c3, even when I create the logger to output everything to stdout (at least that's what I think that code should be doing), I still see only the info message written to the console. 

Any thoughts on what I'm doing wrong here? I can start stepping into the bunyan module, but hoping that I'm just missing something simple.

thanks,

_howard

Howard Dierking

unread,
Oct 23, 2014, 1:17:50 PM10/23/14
to bunyan-...@googlegroups.com
ok - getting a little closer. It appears that it may be actually closing the stream after the info message is written. 

To test this, I wrote directly to console.log after the bunyan call:

var util = require('util');
var bunyan = require('bunyan');
var log = bunyan.createLogger({name: "myapp", src: true });

// is enabled?
console.log(util.format('is info level enabled? %s', log.info()));
log.info("hi");

console.log('HELLO??????')

After the "hi" info message is written out, the program appears to end.

any thoughts?

_howard

Trent Mick

unread,
Oct 26, 2014, 11:50:10 PM10/26/14
to Howard Dierking, bunyan-...@googlegroups.com
Following up for lurkers: As said on twitter I followed up on your gist. https://gist.github.com/howarddierking/7f0dac11809e571651c3
--
Trent Mick

Howard Dierking

unread,
Oct 27, 2014, 6:16:49 PM10/27/14
to bunyan-...@googlegroups.com, howardd...@gmail.com
Thanks Trent - It turns out that the problem seems more related to dtrace on Yosemite than it does bunyan.
Reply all
Reply to author
Forward
0 new messages