My app is running in GKE. Instead of using approach with Logging API I decided to use the simple redirectToStdout with serviceContext config. Unfortunately, it didn't work out. When I call logger.error it doesn't report to Error Reporting. Any suggestions how to solve it?
I've checked again and it looks like it works only if I pass new Error instance to logger.error(...). If I pass a string it does not trigger Error Reporting API. Is it expected behaviour by design or a bug?
@tkgreg, here described how to format error in logs, but I believe you might not be able to set @type field, thus adding new Error is probably the way for now. More related info can be found 754. Turning this issue into feature request for future tracking.
My app is running in GKE. Instead of using approach with Logging API I decided to use the simple
redirectToStdout
withserviceContext
config. Unfortunately, it didn't work out. When I call logger.error it doesn't report to Error Reporting. Any suggestions how to solve it?