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.

logging.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.

<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.
🌐
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.
🌐
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.
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.

logging.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.

<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:

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

application-dev.properties:

logging.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 ;) ).

🌐
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"
🌐
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 ...
🌐
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 › @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 ...
Find elsewhere
🌐
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 › @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
🌐
GeeksforGeeks
geeksforgeeks.org › advance java › set-logging-level-with-application-properties
How to Set the Logging Level with application.properties? - GeeksforGeeks
April 23, 2024 - In Spring Boot, logging is crucial for monitoring, debugging, and troubleshooting Java applications. Spring Boot provides a convenient way to configure logging levels using properties files, particularly the application.properties file of the Spring application.
🌐
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.
🌐
Coding Shuttle
codingshuttle.com › home › handbooks › spring boot handbook › logging in spring boot
Logging in Spring boot | Coding Shuttle
January 14, 2025 - In this case, it is set to DEBUG, meaning all logs at this level and higher (INFO, WARN, ERROR, FATAL) will be captured. appender-ref: This references the appender defined earlier (ROLLING_FILE), so all log messages at the root level will be sent to the rolling file appender. To use this file, we need to tell Spring Boot to reference it. We can do this by configuring it in our application.properties file like this:
🌐
JavaTechOnline
javatechonline.com › home › logger in spring boot
Logger In Spring Boot - JavaTechOnline
August 15, 2023 - 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
🌐
C# Corner
c-sharpcorner.com › article › spring-boot-logging-for-production-and-development-servers
Spring Boot Logging for Production and Development Servers
July 30, 2024 - It aids in debugging, performance monitoring, and auditing by recording events, errors, and other significant occurrences. Spring Boot uses Logback as the default logging framework. However, it also supports other frameworks like Log4j2 and Java Util Logging (JUL). By default, Spring Boot logs output to the console. You can configure the logging behavior using application.properties or application.yml files.
🌐
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>
🌐
HowToDoInJava
howtodoinjava.com › home › spring boot › spring boot logging using properties config
Spring Boot Logging using Properties Config
November 21, 2024 - Main help here is that when we use @Slf4j we can setup a property like below example: logging.level.PACKAGE_ROOT = debug Reply ... I am doing a spring boot based maven project. There I implemented log4j and I am using Console Appender. I am configuring all logging code in the application.properties file.