From the course: Spring on Kubernetes: Deploying and Managing Cloud-Native Applications

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Logging with Spring

Logging with Spring

- [Instructor] The concept of logging should be relatively normal for most developers. It's just how we do things. There are some special considerations you need to take however with Spring Boot to ensure that your logs are structured properly when you're targeting a Kubernetes-type deployment. The first thing that I want you to do is open up wisdom-api, and let's go to our pom file. I'm going to scroll down here to the dependency section, and we are going to add in a new dependency. This dependency is going to come from the group net.logstash.logback, and it's going to have an artifactId of logstash-logback-encoder. And we'll go ahead and specify the version of 7.3, and we're going to go ahead and allow Maven to do the downloads. And now what I want you to do is to open up source, main, resources, and we're going to create a new file in here. And this file will be called logback-spring.xml. Now, we'll go ahead and start this with a configuration tag. And then within there we're going…

Contents