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
🌐
Spring
docs.spring.io › spring-boot › reference › features › logging.html
Logging :: Spring Boot
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 output more information.
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 ;) ).

🌐
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 - If we use Logback, which is used by default in Spring Boot, we can set the log level in the logback-test.xml file within src/test/resources:
🌐
Spring
docs.spring.io › spring-boot › docs › 2.1.8.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 output more information.
🌐
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 - Create a new Spring Boot project with the required dependencies using Spring Initializr. ... 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 the project. spring: application: name: demo-logging logging: level: root: WARN org.example.springloggingdemo: INFO
🌐
Jessitron
jessitron.com › 2020 › 06 › 27 › spring-boot-log-levels-for-development
Spring Boot log levels for development – Jessitron
June 27, 2020 - logging.level.org.springframework=INFO # turn up when necessary # these are worth seeing logging.level.org.springframework.web.servlet.DispatcherServlet=TRACE logging.level.org.springframework.security.web.csrf.CsrfFilter=DEBUG logging.level.org.springframework.security.web.access.intercept.FilterSecurityInterceptor=TRACE logging.level.org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor=TRACE # these are extra chatty and not useful, so keep them quiet even when I turn general logging up logging.level.org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource=INFO logging.level.org.springframework.beans.factory.support.DefaultListableBeanFactory=INFO
🌐
Medium
medium.com › codex › spring-boot-logging-da61911ce8e6
Spring Boot Logging. Spring Boot uses Apache Commons logging… | by Farzin Pashaee | CodeX | Medium
October 13, 2023 - It is also possible to set logging levels using environment variables. (e.g. LOGGING_LEVEL_ORG_SPRINGFRAMEWORK=TRACE will set org.springframeworkto DEBUG). The list of all possible configurations and mapped environment variables can be found on the Spring Boot Reference page.
Find elsewhere
🌐
Medium
kenichishibata.medium.com › on-demand-log-level-changes-in-spring-boot-no-restarts-no-hassle-4f8fd28696bf
On-Demand Log Level Changes in Spring Boot: No Restarts, No Hassle | by Kenichi Shibata | Medium
January 31, 2025 - In a Spring Boot application, you can dynamically change log levels without restarting your pods (or the application itself) by using Spring Boot Actuator’s /actuator/loggers endpoint.
🌐
Medium
medium.com › javarevisited › understanding-logging-in-spring-boot-ac0fd79177b4
Understanding logging in Spring Boot | by Divya Rao | Javarevisited | Medium
July 29, 2022 - With logger methods , we can log messages at all five log level supported by Spring Boot — ERROR , DEBUG, TRACE , INFO , WARNING
🌐
Baeldung
baeldung.com › home › spring › spring boot › logging in spring boot
Logging in Spring Boot | Baeldung
February 19, 2026 - Spring Boot preconfigures it with patterns and ANSI colors to make the standard output more readable. Let’s now run the application and visit the http://localhost:8080/ page, and see what happens in the console: As we can see, the default logging level of the Logger is preset to INFO, meaning that TRACE and DEBUG messages are not visible.
🌐
Spring
docs.spring.io › spring-boot › api › rest › actuator › loggers.html
Loggers (loggers) :: Spring Boot
The loggers endpoint provides access to the application’s loggers and the configuration of their levels. To retrieve the application’s loggers, make a GET request to /actuator/loggers, as shown in the following curl-based example: $ curl 'http://localhost:8080/actuator/loggers' -i -X GET · The resulting response is similar to the following: HTTP/1.1 200 OK Content-Type: application/vnd.spring-boot.actuator.v3+json Content-Length: 791 { "levels" : [ "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" ], "loggers" : { "ROOT" : { "configuredLevel" : "INFO", "effectiveLevel" : "INFO" },
🌐
Last9
last9.io › blog › a-guide-to-spring-boot-logging
Spring Boot Logging: Best Practices for Faster Debugging | Last9
February 19, 2026 - It's mature, well-tested, and handles most use cases without additional configuration. If you don't create any custom config files, Spring Boot uses sensible defaults: INFO-level logging to the console, with timestamps and thread names included.
🌐
Volito
volito.digital › spring-boot-logs-configuring-logging-testing-log-severity-and-adjusting-log-levels-using-the-loggingsystem-class
Spring Boot Logs: Configuring Logging, Testing Log Severity, and Adjusting Log Levels Using the LoggingSystem Class | Volito
October 31, 2024 - The configuration can be done either through application.properties or application.yml files or through more advanced techniques, such as programmatically altering log levels using the LoggingSystem class. The simplest way to configure logging in Spring Boot is through the application.properties file.
🌐
Baeldung
baeldung.com › home › spring › spring boot › changing the logging level at the runtime for a spring boot application
Changing the Logging Level at the Runtime for a Spring Boot Application | Baeldung
January 8, 2024 - We’ll look at three ways of doing that: using the Spring Boot Actuator loggers endpoint, the auto-scan functionality in Logback and finally using the Spring Boot Admin tool. We’re going to start by using the /loggers Actuator endpoint to display and change our logging level.
🌐
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
Spring boot loggers, application loggers, Hibernate loggers, Thymeleaf loggers and many more. Logging levels available - TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF And also you can configure the root level using logging.level.root.
🌐
Stack Abuse
stackabuse.com › guide-to-logging-in-spring-boot
Logging in Spring Boot with SLF4J
March 13, 2023 - In this tutorial, we'll cover how to log in Spring Boot with SLF4J. We'll cover log levels, log groups and the default Logback logger with examples.
🌐
Medium
codefarm0.medium.com › how-to-change-log-levels-dynamically-in-spring-boot-without-restarting-your-service-b83661df9744
How to Change Log Levels Dynamically in Spring Boot (Without Restarting Your Service) | by Arvind Kumar | Medium
November 25, 2025 - But restarting a service just to turn on DEBUG? That’s a crime against uptime. Modern Spring Boot lets you change log levels on the fly — no redeploys, no rolling restarts, no risky config edits in the heat of an incident.
🌐
GeeksforGeeks
geeksforgeeks.org › advance java › set-logging-level-with-application-properties
How to Set the Logging Level with application.properties? - GeeksforGeeks
July 23, 2025 - Spring Boot uses the popular logging framework Logback by default. To set the logging level, we need to edit the application.properties file by specifying the name of the logger and the desired log level of the Spring application.