[Spring Boot] Logging trong Spring Boot

Spring Boot uses Commons Logging for all internal logging but leaves the underlying log implementation open. Default configurations are provided for Java Util LoggingLog4J2, and Logback. In each case, loggers are pre-configured to use console output with optional file output also available.

By default, if you use the “Starters”, Logback is used for logging. Appropriate Logback routing is also included to ensure that dependent libraries that use Java Util Logging, Commons Logging, Log4J, or SLF4J all work correctly.

There are a lot of logging frameworks available for Java. Do not worry if the above list seems confusing. Generally, you do not need to change your logging dependencies and the Spring Boot defaults work just fine.

Read more:

  • Logging feature

https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-logging.html

  • “How-to” uses Logging

https://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html

#spring-boot, #spring-framework