spring boot
debug logging
log messages
configuration
troubleshooting

How to turn off debug log messages in spring boot

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

Turning off debug logs in Spring Boot is usually a matter of setting the right logging level, but there are two different things people often mix up: Boot's debug flag and ordinary logger levels. If you want fewer debug messages in normal application logs, the main setting is the logger level, not just the debug property.

Start with Logger Levels

The simplest way to stop debug output is to set the root logging level to INFO or higher.

In application.properties:

properties
logging.level.root=INFO

Or in application.yml:

yaml
logging:
  level:
    root: INFO

That tells the logging framework not to emit DEBUG messages from loggers that inherit the root level.

Package-Specific Control Is Often Better

Sometimes you want your own code at INFO but a noisy framework package at WARN.

properties
1logging.level.root=INFO
2logging.level.org.springframework.web=WARN
3logging.level.org.hibernate.SQL=OFF
4logging.level.com.example.myapp=INFO

This is often a better real-world solution than globally raising everything, because you can quiet the noisiest libraries without losing useful application logs.

Know What the debug Flag Does

Spring Boot also has a debug property:

properties
debug=false

This property is not the same thing as setting every logger to DEBUG. It mainly turns on extra diagnostic logging for selected core Spring Boot loggers and prints more auto-configuration detail.

So if someone started the app with:

bash
java -jar app.jar --debug

you can remove that flag or set debug=false. But for general debug logging control, logging.level.* is still the main tool.

Logback and Log4j Config Still Apply

Spring Boot uses a logging system underneath, commonly Logback by default. If you provide your own logback-spring.xml, that file can override what you thought the properties were doing.

A simple Logback root level looks like this:

xml
1<configuration>
2    <root level="INFO">
3        <appender-ref ref="CONSOLE" />
4    </root>
5</configuration>

If debug messages continue even after changing application.properties, check whether a custom logging configuration file is taking precedence.

Turn Off Startup Debug Noise in the Right Place

Some logs that feel like "debug noise" are actually coming from specific libraries or features, not from the root logger alone. Examples:

  • SQL logging from Hibernate
  • request tracing from Spring MVC filters
  • actuator-related diagnostics
  • custom debug logs in your own code

That is why targeted configuration is often cleaner than one blanket setting. For example:

properties
logging.level.org.hibernate.SQL=OFF
logging.level.org.springframework.boot.autoconfigure=INFO

This keeps your logs readable without hiding everything useful.

Environment-Specific Logging Helps

A good pattern is to keep development and production logging different. For example:

  • development: DEBUG for your own package
  • production: INFO or WARN

Profile-specific configuration makes that easy:

properties
# application-prod.properties
logging.level.root=INFO
logging.level.com.example.myapp=INFO

That way, you do not need to keep editing the same file every time you switch environments.

Common Pitfalls

  • Assuming debug=false alone controls all debug log messages.
  • Setting the root logger correctly but forgetting a custom logback-spring.xml overrides it.
  • Turning the whole application to WARN and losing useful operational information.
  • Forgetting that specific libraries may have their own noisy package loggers.
  • Leaving --debug on startup commands and then wondering why extra Boot diagnostics appear.

Summary

  • The main way to turn off debug logs in Spring Boot is to raise logger levels, usually with logging.level.root=INFO.
  • Use package-specific logger settings to quiet noisy frameworks without muting everything.
  • Spring Boot's debug flag is related but not identical to ordinary logging levels.
  • Custom Logback or Log4j configuration can override property-based settings.
  • Keep logging configuration environment-specific so production stays quiet without hurting development visibility.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.