Skip to content

improved processing of structured logs #2251

@travi

Description

@travi

I recently got @google-cloud/logging-bunyan working in a hapi app (leveraging good-bunyan) after a very helpful conversation with @ofrobots.

This got us to a much better state of logging than our previous use of good-console to simply write to stdout. However, the log events that are sent to Stackdriver are still not tokenized nearly as well as the logs that we have for some other (non-node) apps we have running in the standard environment.

It appears that the events sent through @google-cloud/logging-bunyan are structured in the bunyan recommended formats, rather than the Stackdriver format. If I understand the docs correctly, Stackdriver would automatically process these better if they were transformed to meet the formats like:

I have not looked very deeply into trying to perform any transformations myself because I wanted to see if the team agreed that it made more sense to be part of the @google-cloud/logging-bunyan library directly. It seems like that would be the most helpful place so that each consumer doesn't need to build the transformations themselves (if event possible).

Would it be reasonable to add this type of transformation into the library to support better log tokenization?

Metadata

Metadata

Labels

api: logging-bunyanpriority: p2Moderately-important priority. Fix may not be included in next release.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions