Update: Starting with Spring Boot v1.2.0.RELEASE, the settings in application.properties or application.yml do apply. See the Log Levels section of the reference guide.

Copylogging.level.org.springframework.web: DEBUG
logging.level.org.hibernate: ERROR

For earlier versions of Spring Boot you cannot. You simply have to use the normal configuration for your logging framework (log4j, logback) for that. Add the appropriate config file (log4j.xml or logback.xml) to the src/main/resources directory and configure to your liking.

You can enable debug logging by specifying --debug when starting the application from the command-line.

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.

Copy<include resource="org/springframework/boot/logging/logback/base.xml"/>     
Answer from M. Deinum on Stack Overflow
🌐
HowToDoInJava
howtodoinjava.com › home › spring boot › spring boot logging with application.yml
Spring Boot Logging with application.yml
July 3, 2023 - In spring boot, you can achieve this by creating multiple application-{profile}.yml files in same location as application.yml file. Profile-specific keys always override the non-profile-specific ones.
Top answer
1 of 16
557

Update: Starting with Spring Boot v1.2.0.RELEASE, the settings in application.properties or application.yml do apply. See the Log Levels section of the reference guide.

Copylogging.level.org.springframework.web: DEBUG
logging.level.org.hibernate: ERROR

For earlier versions of Spring Boot you cannot. You simply have to use the normal configuration for your logging framework (log4j, logback) for that. Add the appropriate config file (log4j.xml or logback.xml) to the src/main/resources directory and configure to your liking.

You can enable debug logging by specifying --debug when starting the application from the command-line.

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.

Copy<include resource="org/springframework/boot/logging/logback/base.xml"/>     
2 of 16
142

You can do that using your application.properties.

logging.level.=ERROR -> Sets the root logging level to error
...
logging.level.=DEBUG -> Sets the root logging level to DEBUG

logging.file=${java.io.tmpdir}/myapp.log -> Sets the absolute log file path to TMPDIR/myapp.log

A sane default set of application.properties regarding logging using profiles would be: application.properties:

Copyspring.application.name=<your app name here>
logging.level.=ERROR
logging.file=${java.io.tmpdir}/${spring.application.name}.log

application-dev.properties:

Copylogging.level.=DEBUG
logging.file=

When you develop inside your favourite IDE you just add a -Dspring.profiles.active=dev as VM argument to the run/debug configuration of your app.

This will give you error only logging in production and debug logging during development WITHOUT writing the output to a log file. This will improve the performance during development ( and save SSD drives some hours of operation ;) ).

🌐
Javadeveloperzone
javadeveloperzone.com › spring-boot › spring-boot-enable-debug-logging
Spring boot enable debug logging – Java Developer Zone
We can use one of following option to enable debug logging in spring boot. Pass debug true in application.properties.
🌐
Spring
docs.spring.io › spring-boot › docs › 1.5.22.RELEASE › reference › html › boot-features-logging.html
26. Logging - Spring
Example application.properties: logging.level.root=WARN logging.level.org.springframework.web=DEBUG logging.level.org.hibernate=ERROR · The various logging systems can be activated by including the appropriate libraries on the classpath, and further customized by providing a suitable configuration ...
🌐
Java67
java67.com › 2021 › 10 › how-to-set-logging-level-in-spring-boot-.html
How to set the logging level in Spring Boot application.properties - Example Tutorial | Java67
So in this tutorial, we are going to discuss how we can implement spring boot logging configuration via application.properties or application.yml, both are valid Spring boot configuration files. By configuration the application.properties file according to below, we can locate it under the resource folder of our application. So given below is the application.properties files which we used in this tutorial. logging.level.org.springframework=DEBUG logging.level.com.howtodoinjava=DEBUG #this is used to store the loggers in the tempdir folder logging.file=${java.io.tmpdir}/application.log # The way how you create the logging files logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg% # The way how you write the logging patterns within the file logging.pattern.console= %d{yyyy-MM-dd HH:mm:ss} - %msg%
🌐
Medium
medium.com › @AlexanderObregon › debugging-and-troubleshooting-spring-boot-applications-tips-and-tricks-5206d63a60ba
Debugging and Troubleshooting Spring Boot Applications — Quick Tips and Tricks
April 23, 2024 - When you run your application with the --debug option or enable debug logging for org.springframework.boot.autoconfigure, Spring Boot generates an auto-configuration report that lists all applied and non-applied configurations, which can help ...
🌐
Spring
docs.spring.io › spring-boot › docs › 2.1.13.RELEASE › reference › html › boot-features-logging.html
26. Logging
By default, ERROR-level, WARN-level, and INFO-level messages are logged. You can also enable a “debug” mode by starting your application with a --debug flag. ... When the debug mode is enabled, a selection of core loggers (embedded container, Hibernate, and Spring Boot) are configured to ...
Find elsewhere
🌐
Baeldung
baeldung.com › home › spring › spring boot › setting the log level in spring boot when testing
Setting the Log Level in Spring Boot When Testing | Baeldung
February 20, 2026 - Setting the log level in Spring Boot’s application.properties is the easiest option, especially when we’re using the @SpringBootTest annotation.
🌐
ConcretePage
concretepage.com › spring-boot › spring-boot-logging-example
Spring Boot Logging Example
December 3, 2023 - Using application.yml · path: ... are displayed by default. We can enable DEBUG and TRACE log levels using command line as well as property file....
🌐
Medium
medium.com › @shivamtyagicool › how-to-view-debug-logs-in-spring-boot-with-hibernate-1f7f83282251
How to View Debug Logs in Spring Boot with Hibernate | by Shivam Tyagi | Medium
February 11, 2025 - Spring Boot uses SLF4J along with Logback as the default logging framework. By default, it logs at the INFO level. TRACE: Most detailed logs. DEBUG: Useful for debugging, contains more information than INFO. INFO: General application flow logs. WARN: Logs for potential issues. ERROR: Logs for failures and errors. There are multiple ways to enable debug logs in Spring Boot.
🌐
Medium
medium.com › @ByteCodeBlogger › configuring-logging-in-spring-boot-application-yml-application-properties-201b81d4d8b4
Configuring Logging in Spring Boot application.yml/application.properties— Print JPA , Hibernate, HTTP & SPA logs | by Full Stack Developer | Medium
October 20, 2024 - (All the keywords are same whether you follow YML, YAML or Properties file pattern.) To start with, here’s a simple logging configuration that sets a general logging level for your application. logging: level: root: INFO # Set the general logging level for the application · To capture logs related to Hibernate, such as SQL statements and parameter bindings, you can add the following configuration: logging: level: org.hibernate.SQL: DEBUG # Log SQL statements executed by Hibernate org.hibernate.type.descriptor.sql: TRACE # Log SQL parameter binding
🌐
Spring
docs.spring.io › spring-boot › reference › features › logging.html
Logging :: Spring Boot
Enabling the debug mode does not configure your application to log all messages with DEBUG level. Alternatively, you can enable a “trace” mode by starting your application with a --trace flag (or trace=true in your application.properties). Doing so enables trace logging for a selection of core loggers (embedded container, Hibernate schema generation, and the whole Spring portfolio). If you want to disable console-based logging, you can set the logging.console.enabled property to false.
🌐
OneUptime
oneuptime.com › home › blog › how to configure logging in spring boot
How to Configure Logging in Spring Boot
December 22, 2025 - # application.yml logging: level: root: INFO com.example: DEBUG org.springframework: WARN org.hibernate.SQL: DEBUG org.hibernate.orm.jdbc.bind: TRACE file: name: logs/application.log logback: rollingpolicy: max-file-size: 10MB max-history: 30 total-size-cap: 1GB pattern: console: "%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight(%-5level) [%thread] %cyan(%logger{36}) - %msg%n" file: "%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{36} - %msg%n"
🌐
Baeldung
baeldung.com › home › spring › spring security › enable logging for spring security
Enable Logging for Spring Security | Baeldung
March 11, 2026 - Like any Spring or Java application, we can use a logger library and define a logging level for the Spring Security modules. Typically, we can write in our configuration file something like: <logger name="org.springframework.security" level="DEBUG" ...
🌐
JavaTechOnline
javatechonline.com › home › logger in spring boot
Logger In Spring Boot - JavaTechOnline
November 9, 2025 - Spring Boot, along with logging frameworks like SLF4J and Logback, provides a set of standard logging levels that are commonly used to indicate different levels of severity. These are trace, debug, info, warn, and error. Below is the arrangement of the levels based on their severity: ... By default info & above level messages are enabled. In order to receive other level messages, go to application.properties and add below entries accordingly: logger.level.root=TRACE
🌐
Baeldung
baeldung.com › home › spring › spring boot › logging in spring boot
Logging in Spring Boot | Baeldung
February 19, 2026 - Spring 5 instead handles it automatically, so we don’t need to do anything when using Spring Boot 2. While Unix-based operating systems such as Linux and Mac OS X support ANSI color codes by default, on a Windows console, everything will be sadly monochromatic. Windows can obtain ANSI colors through a library called JANSI. We should pay attention to the possible class loading drawbacks, though. We must import and explicitly activate it in the configuration as follows: ... <configuration debug="true"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <withJansi>true</withJansi> <encoder> <pattern>[%thread] %highlight(%-5level) %cyan(%logger{15}) - %msg %n</pattern> </encoder> </appender> <!-- more stuff --> </configuration>
🌐
Tourpinyata
tourpinyata.com › spring-boot-logging-level-example
Different Ways of Configuring Logging Level in Spring Boot – Tour Pinyata
Command line arguments are employed to initiate the Java application with the specified logging level. The Java command for running the application with logging level configuration is exemplified below: java -jar <jar> --debug java -jar YourSpringBootApp.jar --logging.level.root=INFO
🌐
GeeksforGeeks
geeksforgeeks.org › advance java › setting-the-log-level-in-spring-boot-when-testing
Setting the Log Level in Spring Boot When Testing - GeeksforGeeks
May 15, 2024 - ... Once the project is created, the file structure will resemble the image below. Open the application.properties file rename to application.yml and add the configuration for the logging of the root and package of the Spring application in ...