Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log process.stdout and file #314

Closed
marales opened this issue Nov 15, 2015 · 1 comment
Closed

Log process.stdout and file #314

marales opened this issue Nov 15, 2015 · 1 comment

Comments

@marales
Copy link

marales commented Nov 15, 2015

I would like to log the messages in both stdout and file on every logging level, i didn't find an configuration. It's this possible ?

@trentm
Copy link
Owner

trentm commented Feb 1, 2016

@marales Apologies for the delay in responding (see #335 if you are curious about that).

I think this should do what you want:

var bunyan = require('bunyan');
var log = bunyan.createLogger({
    name: 'issue314',
    streams: [
        {
            stream: process.stdout,
            level: 'trace'
        },
        {
            path: '/var/log/a.log',
            level: 'trace'
        }
    ]
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants