How to start a springboot application in debug mode?
Table of Contents
How to start a springboot application in debug mode?
Using appliation-properties
Add this to application.properties file
debug=true
logging.level.org.springframework.web: DEBUG
logging.level.org.hibernate: ERROR
The proper way to set the root logging level is using the property logging.level.root. See http://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-custom-log-levels
logging.level.root=WARN
From command-line
Start the application with the –debug switch
$ java -jar myproject-0.0.1-SNAPSHOT.jar --debug
Using logback
Spring Boot provides also a nice starting point for logback to configure some defaults, coloring etc. the base.xml file which you can simply include in your logback.xml file. (This is also recommended from the default logback.xml in Spring Boot.
<include resource="org/springframework/boot/logging/logback/base.xml"/>
See
- https://github.com/spring-projects/spring-boot/tree/v1.2.1.RELEASE/spring-boot/src/main/resources/org/springframework/boot/logging/logback
- https://github.com/explorer436/programming-playground/tree/main/java-playground/request-logging/using-spring-CommonsRequestLoggingFilter