googleapis / nodejs-logging-bunyan

Node.js client integration between Stackdriver Logging and Bunyan.
https://cloud.google.com/logging/
Apache License 2.0
63 stars 34 forks source link

Logging to stdout in Cloud Run creates a JSON object as "message" #643

Closed losalex closed 2 years ago

losalex commented 2 years ago

When enabling structured logging to STDOUT, received structured JSON payload containing an extra "message" key with the original logged message, as well as a "metadata" key of an empty object.

sytranvn commented 1 year ago

image I'm using Cloud Run and logging-bunyan@v4.2.2 and it's logging message object when enable redirectToStdout.

This document says useMessageField is always true but #644 tests expect it to be false.

Note that there is also a useMessageField option which controls if "message" field is used to store structured, non-text data inside jsonPayload field when redirectToStdout is set. By default useMessageField is always true.