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

"msg" field is empty #517

Closed
DanielHreben opened this issue Jul 3, 2017 · 3 comments
Closed

"msg" field is empty #517

DanielHreben opened this issue Jul 3, 2017 · 3 comments

Comments

@DanielHreben
Copy link

In some reason this code

const bunyan = require('bunyan')
const logger = bunyan.createLogger({name: 'myapp'})
logger.warn({msg: 'test'})

will output log entry with empty "msg" field:

{"name":"myapp","hostname":"Daniels-MacBook-Air.local","pid":32837,"level":40,"msg":"","time":"2017-07-03T21:41:43.325Z","v":0}
@ORESoftware
Copy link

msg might be a predefined field? check the README

@ORESoftware
Copy link

when you close a question @DanielHreben it's good etiquette to explain what the problem/answer was so that you could potentially help others lol.

@DanielHreben
Copy link
Author

DanielHreben commented Aug 18, 2017

@ORESoftware Well, I will be happy to explain that, but I don't understand real reasons, from your answer I only realize that's not a bug, since msg is a predefined field.
"err" is also predefined field, but it works that way:

logger.error({err: new Error()}) // "err" field will be present, everything is ok

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

No branches or pull requests

2 participants