Can we specify to which stream to write, when logging ?

52 views
Skip to first unread message

she...@bluejeansnet.com

unread,
Jul 7, 2015, 1:42:11 AM7/7/15
to bunyan-...@googlegroups.com
I have a use case where i have two file streams attached to a logger, to write to two seperate files.

*
logger = bunyan.addStream({
                    name : 'stream1',
                    type    : 'rotating-file',
                    period  : '1d',
                    path    : 'file1'
                });
logger = bunyan.addStream({
                    name : 'stream2'
                    type    : 'rotating-file',
                    period  : '1d',
                    path    : 'file2'
        });
*

Can i user something like this ???
logger.info("Hello Brother", {stream: 'stream1'}) //to write the log into file1
logger.info("I am good", {stream: 'stream2'}) // to write the log into file2
Reply all
Reply to author
Forward
0 new messages