From the course: Creating Spring Boot Microservices
Unlock the full course today
Join today to access over 24,400 courses taught by industry experts.
Add a runtime logger - Spring Boot Tutorial
From the course: Creating Spring Boot Microservices
Add a runtime logger
- [Instructor] Here is a very valuable comment, "Please add logging to this project," I completely agree. Logging is a valuable tool for monitoring, accessing, and debugging an application at runtime. In Java, the important artifacts for logging are the logger, which is responsible for capturing events, appender, records the events, and layouts, which are responsible for the appearance of the data in the log entry. There are several logging frameworks available, like java.util.logging, Log4j, and Logback. An abstraction layer, such as SLF4J, decouples an application from any of these frameworks, which allow it to bind to a specific logging framework at runtime. Logging events in code is very easy. Each class instantiates a class scoped logger, then calls methods on it to record the events according to its imports or severity. Explorecali uses the Logback framework where there are four kinds of events, error, warning, info, debug, and trace. Trace is the lowest event, which may only be…