mhart / gelf-stream

A node.js stream to send JS objects to a Graylog2 server (in GELF format)
Other
29 stars 13 forks source link

Graylog does not process messages with empty `msg` #13

Closed rhduwe closed 7 years ago

rhduwe commented 8 years ago

This works as expected:

log.info("message");
log.info({object: object}, "message");

But those get marked in graylog as "incomplete", while still being written normally to other streams:

log.info({"test":"test"});
log.info(config);
log.info("");
FBerthelot commented 7 years ago

@mhart I have the same issue.

I think the problem came from your gelfling module, but I'm not sure

mhart commented 7 years ago

@rhduwe @FBerthelot well msg is a required field for Bunyan if you're using record objects: https://github.com/trentm/node-bunyan#core-fields

I'm going to close this as the bunyan mapper expects the input to be a valid bunyan record.

FBerthelot commented 7 years ago

To me the only problem here is when you are calling :

log.info({"test":"test"});

The msg is not empty at all, but your are considering it like an empty message.

mhart commented 7 years ago

@FBerthelot Not sure what you mean? msg is absolutely empty in your example – the only property you've got there is test. If you're sending objects to Bunyan, you need to have a msg property

FBerthelot commented 7 years ago

@mhart nevermind, I was totaly wrong.

I believed that msg was the english shortcut for message and refer to the first parameter of the logging function...

For your information, we use your plugin for a famous french news website and it work like a charm now ;)

Thank you