From the course: Extending, Securing, and Dockerizing Spring Boot Microservices

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Adding a runtime logger

Adding a runtime logger

From the course: Extending, Securing, and Dockerizing Spring Boot Microservices

Start my 1-month free trial

Adding a runtime logger

- [Instructor] 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. Error is the highest and most severe event meaning something really bad and unexpected happened. Trace is the lowest level event which may…

Contents