-
Notifications
You must be signed in to change notification settings - Fork 518
Closed
Description
I'm using Bunyan for the purposes of an npm library. I have set it up so as to provide child-loggers for each module, and then expose the root logger.
When a stream is attached to the root logger using addStream()
it will not receive any messages logged by the child loggers.
You can reproduce with the following snippet:
var rootLogger = bunyan.createLogger({
name: 'root',
level: 'info',
// Mute logger
streams: [],
});
var childLog = rootLogger.child({module: 'child-module'});
rootLogger.addStream({
type: 'stream',
stream: process.stdout,
}, 'debug');
childLog.debug('Hello there');
childLog.info('Hello there');
childLog.warn('Hello there');
childLog.error('Hello there');
console.log('should have logged');