Set record.message to ensure msg is shown in the Stackdriver UI#7
Conversation
|
LGTM. (For clarity, it's Bunyan and not this or express-bunyan that set the |
|
Thanks for the "LGTM" @zbjornson. Yes I came across that and combined with the line here: https://github.com/trentm/node-bunyan/blob/master/lib/bunyan.js#L963 ...makes it so that this can't be worked around even with a custom error serialiser. Let me know if there is anything more I can do to help ensure this can be merged. |
|
LGTM |
Stackdriver/Google error reporting requires that error logs have a V8 stacktrace as the payload `message`: https://cloud.google.com/error-reporting/docs/formatting-error-messages They also require setting a service context (`"serviceContext": {"service": "worker"}`) but this can be done in serialisers or on Bunyan loggers themselves
|
I've made an additional change to this PR that looks for an error on This is required by the Google Stackdriver Error Reporting functionallity for automatically pulling error logs from the logging service into the error reporting service. There are some additional required properties for this functionallity but these are able to be set from on a logger or applied via a serialiser (and the source of the values will be application specific) so I have not included them here. Let me know what you think, I'm happy to revert this additional change if it moves too far away from the original intent of this stream plugin. I have also bumped the version number as requested. UPDATE: Thinking about it a bit more, perhaps when there is a Also, perhaps the |
|
It would be awesome to have your observations about where these fields show up in the Stackdriver interface documented in the readme since I don't think they're in Google's docs, maybe even including the additional fields that you mentioned. I would only assign the message to |
|
@zbjornson I have made the requested changes. Let me know if the addition to the Readme wasn't what you had in mind. And thank you again for taking the time to review and consider this PR. |
|
LGTM. |
|
Me too! Thanks @Binarytales |
This is quite a small change and there may be a better or more idiomatic way to achieve this but I found that this change was need to change this:
to this: