-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diffrences in log entry structure with different modes of redirectToStdout (missing resource.labels.function_name when redirectToStdout:true) #791
Comments
Hi @evil-shrike, I am wondering are you still running into this issue? If so, do you mind providing a latest repro? |
Hi @cindy-peng . Yes, the issue is still actual.
it's the output:
it's more or less looks good. |
Hi @evil-shrike, like you have probably already figured out here, this logic is not controlled by logging client libraries but controlled by the integrated logging agent on cloud functions environment: https://cloud.google.com/logging/docs/agent/logging/configuration#process-payload In the underlying nodejs-logging library, we process and set In this case, I would recommend reaching out to the logging agent's team and see if this is intended: I am closing this issue for now. Please let me know if there is any other question. Thank you! |
I have a lib, that uses winston for logging, which I want to use inside my cloud function and integrate its logging with Cloud Logging. So inside the lib I check whether it's running in Cloud and if so I create a winston logger with LoggingWinston transport:
where createCloudLogger is:
Please note I specify
redirectToStdout: false
.It worked fine in general but recently I've noticed that in logs there're a lot of entries like this:
DEFAULT 2023-04-17T11:03:56.398817Z Exception from a finished function: Error: Total timeout of API google.logging.v2.LoggingServiceV2 exceeded 60000 milliseconds before any response was received.
and sometime they are even turned into error:
in the related bug googleapis/nodejs-logging#1185 it's suggested to turn on stdout writing.
So I changed
redirectToStdout
to true.Unfortunately the result isn't the same.
Here's a log entry with

redirectToStdout: false
:Here's a log entry with

redirectToStdout: true
:there are very similar but
redirectToStdout: true
resource.labels.function_name goes to jsonPayload instead of to the root object as withredirectToStdout: false
. Which results in missing label (chip) with function name on the log entry.The text was updated successfully, but these errors were encountered: