The default log entry of a .netcore app is being written to the stdout and interpreted by the GCP Stackdriver as an info message, even if it is an error. Is there a way to write .netcore errors to the stderr or configure them somehow so that Stackdriver will interpret them as errors?
per Panagiotis Kanavos@:
If you insist on writing to console you'll have to remove the default console logger and add another one. The
Microsoft.Extensions.Logging.Console
logger is very basic, with a hard-coded format that writes parts of a single event in different lines. It can't be customised and isn't meant to - it's only meant to be the most basic default. Serilog's Console provider offers extensive customisation but why use the console when you can already send events to StackDriver?
This did solved the original issue, per Kiramm@:
I removed the default console logger and added Google's logger factory and the Stackdriver started interpreting log entries severity correctly