Tag Archives: logging with Spring Boot

CAN YOU CONTROL LOGGING WITH SPRING BOOT? HOW?

Can you control logging with Spring Boot? How?

Yes, we can control logging with spring boot.

Customizing default Configuration for Logging:

By adding logback.xml file to the application we can override the default logging configuration by providing the Spring Boot. This file isplaced in the classpath (src/main/resources) of the application for Spring Boot to pick the custom configuration.

Spring Boot can control the logging level

  • Just set it in application.properties
  • Works with most logging frameworks
  • Java Util Logging, Logback, Log4J, Log4J2

logging.level.org.springframework=DEBUG
logging.level.com.acme.your.code=INFO