-
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
Log levels and objects do not show in Cloud Logging from Cloud Functions #610
Comments
Can confirm this is happening in |
I tried this with 3.0.6 and it has the same effect |
I don't think this is the first time the issue has surfaced, but I don't have the version numbers for when it last occurred. |
About the severity not reported properly in Stackdriver, I had to configure it manually using a format and a mapper from level to SD severity. This is because the severity information is not reported in the metadata of the log (issue reported here but I guess still existing #285)
|
It is possible that the observed behavior is a result of the execution of assignSeverityToEntries method. |
@sshquack, |
@toninofox suggestion fixed our problem (thank you!), but it also revealed that... we don't really need this library, at least not in our case. Explicitly setting the severity and formatting as JSON with the default transport gives us the same result, so for simpler applications, that may be all that's necessary. This is actually perfect for us, as we're working with Cloud Run instances, and using this library sometimes results in log messages getting lost if they aren't all flushed by the time the instance dies/sleeps. In cases where there's a crash shortly after the container starts, we would never get messages and would be unable to diagnose the problem easily. The standard transport doesn't have this problem. |
Environment details
@google-cloud/logging-winston
version:Steps to reproduce
I followed the quick start sample at https://cloud.google.com/logging/docs/setup/nodejs#using_winston and none of my log levels and objects show-up in Winston Cloud Logging from Cloud Functions.
npm
@google-cloud/functions-framework
and it works as expected.Please help!
The text was updated successfully, but these errors were encountered: