GAE node.js console.error() not logging as ERROR log level
tl;dr - it's not supported.
Longer Answer
So it seems like Google has updated their documentation since I've posted my question. They've clarified that writing to stdout
and stderr
is collected, but:
does not provide log levels that you can use for filtering in the Logs Viewer
It's great that I have an answer, which is: "No, console.log()
and console.error()
will not have log levels." This kind of contradicts the next paragraph. I may be misreading or misinterpreting the documentation, so please comment if that's the case.
I took a screenshot of the documentation, pointing out what I'm referring to, in case they update it again:
Solution
Use one of the logging libraries that Google supports with a Stackdriver logging transport, like @darshan-devrai's answer. If you don't want to change all your console.log()
, console.error()
, etc., then just alias the console logger to your logger of choice (similar to this stackoverflow answer).