You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great work on winston-loggly. We've been using it for a while, and it generally works great, but we had one request.
Currently, when you look at the logs on Loggly, the level and message are always last, following all the other metadata. This isn't great: the level is probably the most important high-order information worth processing, and the message gives context to the rest of the metadata.
E.g.
req=33609775, method=GET, url=/users, currentUser=, error=Error: socket hang up
at createHangUpError (http.js:1124:15)
at CleartextStream.socketCloseListener (http.js:1173:23)
at CleartextStream.emit (events.js:88:20)
at Array.<anonymous> (tls.js:792:22)
at Array.1 (/app/www/node_modules/nodetime/lib/core/proxy.js:131:20)
at EventEmitter._tickCallback (node.js:190:38)
...
, level=error, message=Unhandled error!
I suspected this was because the JSON getting sent to Loggly lists the level and message as the last keys, when they could/should be the first. And indeed, that seems to be it:
This would be solved by creating an object with level and message first, then extending it with meta, instead of cloning meta first and adding level and message second.
I would be happy to submit this as a pull request, but I wasn't sure how you preferred the implementation: Winston unfortunately doesn't expose an extend utility like it does clone, so is that something that belongs there, or here?
Thanks again for the great work, and for the consideration!
The text was updated successfully, but these errors were encountered:
Great work on winston-loggly. We've been using it for a while, and it generally works great, but we had one request.
Currently, when you look at the logs on Loggly, the level and message are always last, following all the other metadata. This isn't great: the level is probably the most important high-order information worth processing, and the message gives context to the rest of the metadata.
E.g.
I suspected this was because the JSON getting sent to Loggly lists the level and message as the last keys, when they could/should be the first. And indeed, that seems to be it:
https://github.com/indexzero/winston-loggly/blob/v0.6.0/lib/winston-loggly.js#L103-L107
This would be solved by creating an object with level and message first, then extending it with meta, instead of cloning meta first and adding level and message second.
I would be happy to submit this as a pull request, but I wasn't sure how you preferred the implementation: Winston unfortunately doesn't expose an
extend
utility like it doesclone
, so is that something that belongs there, or here?Thanks again for the great work, and for the consideration!
The text was updated successfully, but these errors were encountered: