Marcos J.C Kichel
Marcos J.C Kichel

Reputation: 7219

Spring Boot: How to properly send error logs to Stackdriver on GCP

I have this Spring Boot application deployed on a kubernetes cluster on GCP.

Logs are sent to stackdriver and I can't see them on logging section as you can see below:

enter image description here

But they have the wrong severity (INFO) on the platform, that means they don't appear on the error reporting section.

My question is what is needed to be configured to get logs produced by a spring boot application to be read properly by Stackdriver.

Upvotes: 4

Views: 3243

Answers (1)

somegcpjavahelp
somegcpjavahelp

Reputation: 56

Could you provide your logging code?

In the meantime, there's a Google-supported Spring Boot Logging integration, and here's a sample of that: https://github.com/spring-cloud/spring-cloud-gcp/blob/master/spring-cloud-gcp-samples/spring-cloud-gcp-logging-sample/src/main/java/com/example/ExampleController.java

This sample uses a org.apache.commons.logging.Log, so you could do Log.error().

Upvotes: 3

Related Questions