express
express copied to clipboard
EXPRESS logs on GCP stackdriver
Hi ,
Can anyone please help me with this , there is DEBUG flag enabled in my node API set as express* which i guess is printed below errors, But can someone please explain why they are getting marked as error, and if there is any error what is that how can I fix it.
please find the images for reference.
@sharmankita what exactly is the issue that you are facing?
Is your code working fine locally? Are there error logs for the same?
@aravindvnair99 Nope not getting errors on local, When I enable debug mode on local it is showing me same logs normally in colors. but IDK why it is printing it in stack driver as error.
Can anyone please help me with this?
Are you sure you sure not logging to stderr
? I have a similar issue with logging from Go binaries and I think Google Logging falls back to error
log level when it's unable decipher what the level is. Maybe structured logging helps in this case
(Great profile picture :))
Are you sure you sure not logging to
stderr
? I have a similar issue with logging from Go binaries and I think Google Logging falls back toerror
log level when it's unable decipher what the level is. Maybe structured logging helps in this case(Great profile picture :))
I am not logging anything manually.. When I enable debug logs express is printing logs like below screenshot.
Thanks :) @weyert
I understand but can you check the labels in Google Logging for one of the log entries whether you don't have something like this in labels
the value logName: "projects/my-project/logs/stderr"
. That would mean it picked it up the messages from the stderr
stream which are alway marked as errors.
If not, you might want to consider structured logging to make sure Google Logging picks up the correct log level. I have to admit I wouldn't know how to that for the debug
-package, though. This is one of my personal pain peeves with Google Logging