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 - Spring Boot Tutorial
From the course: Spring on Kubernetes: Deploying and Managing Cloud-Native Applications
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
-
-
-
Cloud native applications6m 15s
-
(Locked)
Creating the application3m 22s
-
(Locked)
Preparing data access6m 45s
-
(Locked)
Building data access4m 2s
-
(Locked)
Exposing as a webservice4m 43s
-
(Locked)
Challenge: Cloud Native Spring1m 25s
-
(Locked)
Solution: Cloud Native Spring4m 24s
-
(Locked)
Logging with Spring5m 7s
-
(Locked)
Metrics with Spring6m 20s
-
-
-
-
-