-
Notifications
You must be signed in to change notification settings - Fork 49
Logging to stdout in Cloud Run creates a JSON object as "message" #704
Copy link
Copy link
Closed
Labels
api: loggingIssues related to the googleapis/nodejs-logging-winston API.Issues related to the googleapis/nodejs-logging-winston API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Metadata
Metadata
Assignees
Labels
api: loggingIssues related to the googleapis/nodejs-logging-winston API.Issues related to the googleapis/nodejs-logging-winston API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Environment details
@google-cloud/logging-winstonversion: 4.2.3Steps to reproduce
When enabling structured logging to STDOUT, I do recieve a structured JSON payload as output, that is picked up by Stackdriver from the Cloud Run logs, so far so good. The "message" however, is in itself a JSON payload containing a "message" key with the original logged message, as well as a "metadata" key of an empty object. As a result, each line in my log output in Stackdriver shows a JSON object (that can then be expanded to show the outer JSON object).
I have attempted to change the format that Windsor is using, but it does not appear to be a problem at that level, without this transport, I am seeing plain text "message" output.
Is there a way to prevent this extra level of object being created and instead have the "message" be just the string I've logged?