From the documentation at https://docs.spring.io/spring-boot/reference/features/logging.html#features.logging.console-output :

you can also specify debug=true in your application.properties.

When the debug mode is enabled, a selection of core loggers (embedded container, Hibernate, and Spring Boot) are configured to output more information.

Answer from abaghel on Stack Overflow
🌐
Spring
docs.spring.io › spring-boot › docs › 1.5.22.RELEASE › reference › html › boot-features-logging.html
26. Logging - Spring
When the debug mode is enabled, ... 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 ......
Discussions

java - What Does The Spring Boot "debug" Config Property Set? - Stack Overflow
If I configure my Spring Boot web app with the following property in my application.yaml config file: debug: true I've noticed that my logging config gets ignored and everything is set to a DEBUG ... More on stackoverflow.com
🌐 stackoverflow.com
Spring Boot 3.3.0 Native debug=true in application.properties No effect
I need to debug my Spring Boot v3.3.0 native application built using mvn package -P as it is failing to load application properties from AWS parameter store which was otherwi... More on github.com
🌐 github.com
9
May 28, 2024
java - Spring boot properties difference between `debug=true` and `logging.level.root=debug` - Stack Overflow
When the debug mode is enabled, a selection of core loggers (embedded container, Hibernate, and Spring Boot) are configured to output more information. More on stackoverflow.com
🌐 stackoverflow.com
java - How to debug Spring Boot autoconfiguration - Stack Overflow
Enable Spring Boot's debugging by adding debug=true to your application.properties file. More on stackoverflow.com
🌐 stackoverflow.com
🌐
Baeldung
baeldung.com › home › spring › debugging spring applications
Debugging Spring Applications | Baeldung
February 2, 2026 - There are several ways to start Spring Boot applications. The simplest way is from the command line using the java command with the -jar option. To enable debugging, we simply add the debug argument using the -D option:
🌐
GitHub
github.com › spring-projects › spring-boot › issues › 40930
Spring Boot 3.3.0 Native debug=true in application.properties No effect · Issue #40930 · spring-projects/spring-boot
May 28, 2024 - I need to debug my Spring Boot v3.3.0 native application built using mvn package -P <native-profile> as it is failing to load application properties from AWS parameter store which was otherwise working fine till Spring Boot v3.2.5 · So, have added debug=true in application.properties and expected to see additional information on the config failure reported via org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter, but no effect
Published   May 28, 2024
Author   syedyusufh
🌐
Jamie Tanna
jvt.me › posts › 2022 › 02 › 13 › spring-debug-mode
Determining if the Spring Boot Application is Running in Debug or Trace Mode · Jamie Tanna | Software Engineer
February 13, 2022 - You can do this by running in debug mode, which is most commonly done by setting the debug command-line flag: java -jar /path/to/boot.jar --debug · Or by specifying in our properties file that we're using debug mode: debug=true ·
Find elsewhere
🌐
JetBrains
jetbrains.com › help › idea › run-debug-configuration-spring-boot.html
Spring Boot run configuration | IntelliJ IDEA Documentation
3 weeks ago - The following options are specific to the Java compiler and runtime for your Spring application: The following options are related to logging the execution of this configuration. For more information, refer to Logs. The following options are related to code coverage. For more information, refer to Code coverage. In this area, you can specify tasks to be performed before starting the selected run/debug ...
🌐
Spring
docs.spring.io › spring-boot › docs › 2.1.13.RELEASE › reference › html › boot-features-logging.html
26. Logging
When the debug mode is enabled, ... 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 ......
🌐
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 - Spring Boot’s auto-configuration feature simplifies the setup of your application, but sometimes issues may arise due to misconfiguration. 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 you identify misconfigurations.
🌐
EDUCBA
educba.com › home › software development › software development tutorials › spring tutorial › spring boot debug
spring boot debug | Learn how to debug the spring boot application?
April 3, 2023 - To start the web logic server by using debug enables, we need to set the environment variable to debug flag as true. We can start the glassfish server by using the execution file name as asadmin.
Address   Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
JetBrains
jetbrains.com › help › idea › spring-debugger.html
Spring debugger | IntelliJ IDEA Documentation
2 weeks ago - : abstract XML beans (defined with the abstract="true" attribute in XML files). : infrastructure beans—that is, beans defined in XML files related to the configuration and general infrastructure support, such as ViewResolver or beans with context:component-scan. : beans with the prototype scope (defined with the scope="prototype" in XML files). ... You can disable Spring Debugger features for a specific run/debug configuration.
Top answer
1 of 1
7
  1. Enable Spring Boot's debugging by adding debug=true to your application.properties file.

    This creates log output during startup. For each auto-configuration available it contains the information if it "matched" or not, i.e. if it's preconditions are fulfilled, and what these conditions are.

  2. Look especially in the section Negative matches of the output for auto-configurations that should happen but don't. Searching for relevant technologies in the log is a good idea.

  3. auto-configurations you found in the previous step might hint at other auto-configurations that didn't get activated. For these repeat step 2.

The following is an example of that search for https://github.com/iosenberg/todo/commit/c4cfbf63132e251ce98cfe02178bd48cc447aac7 Which was referenced in Spring boot can't find Repository bean

The missing bean is a Spring Data JDBC repository. Therefore datasource or jdbc come to mind as first search terms. Searching for JDBC yields the following results that seem relevant:

   DataSourceAutoConfiguration matched:
      - @ConditionalOnClass found required classes 'javax.sql.DataSource', 'org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType' (OnClassCondition)
      - @ConditionalOnMissingBean (types: io.r2dbc.spi.ConnectionFactory; SearchStrategy: all) did not find any beans (OnBeanCondition)

   DataSourceTransactionManagerAutoConfiguration matched:
      - @ConditionalOnClass found required classes 'org.springframework.jdbc.core.JdbcTemplate', 'org.springframework.transaction.TransactionManager' (OnClassCondition)

This looks like there is a DataSource, which just demonstrates that you shouldn't stop at the first match.

The next match is:

   DataSourceInitializationConfiguration:
      Did not match:
         - @ConditionalOnSingleCandidate (types: javax.sql.DataSource; SearchStrategy: all) did not find any beans (OnBeanCondition)
      Matched:
         - @ConditionalOnClass found required class 'org.springframework.jdbc.datasource.init.DatabasePopulator' (OnClassCondition)

So, DataSourceAutoConfiguration did run, but we still don't seem to have a DataSource bean. From this we learn that there is an important difference between a class being available and a bean of that type being available. Kind of obvious when you say it out loud, yet easy to miss when you look at some log file.

The rest of the search turns up just more stuff that doesn't work, which is either irrelevant, or not surprising if there is no DataSource bean. Therefore I switched to searching for datasource in the log.

That returns tons of hits. But the first one in the Negative matches was really helpful.

   DataSourceAutoConfiguration.EmbeddedDatabaseConfiguration:
      Did not match:
         - EmbeddedDataSource did not find embedded database (DataSourceAutoConfiguration.EmbeddedDatabaseCondition)

So no embedded database found! What database is it trying to use? Checking the application.properties for a JDBC url shows there is none. Checking the dependencies shows there is an embedded database, but only with scope test, therefore for the main program there is no JDBC driver available. Fixing that by making the in memory database dependency available for the main application solved the proble.

🌐
Reddit
reddit.com › r/javahelp › how do you debug spring application?
r/javahelp on Reddit: How do you debug spring application?
April 20, 2024 -

Sometimes I missed the required annotation or use the annotation wrongly to make it work. Is there any way to troubleshoot it? Besides copying from working example?

Top answer
1 of 5
4
Depending on what you mean by debug, it's not a spring thing, it's an IDE thing. If you mean "I forgot to put the @ Component annotation on something, and now when I try to autowire it is null.... " Well there is your giveaway as to the cause. The challenge here is "i forgot to tell spring that I have this bean"...what exactly is spring going to tell you about something it doesn't know anything about. You should be able to get ahold of the application context and list all of the beans there, that is about the best I've got for you.
2 of 5
1
Please ensure that: Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions You include any and all error messages in full You ask clear questions You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions. Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar If any of the above points is not met, your post can and will be removed without further warning. Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png ) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc. Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit. Code blocks look like this: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello World!"); } } You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above. If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures. To potential helpers Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 9250565005586-Maven-Run-configuration-spring-boot-unable-to-debug
Maven Run configuration spring boot unable to debug. – IDEs Support (IntelliJ Platform) | JetBrains
However, Spring Boot run does not generate a build.properties file like mvn spring-boot:run does which my app needs to be able to run correctly. I found this: https://intellij-support.jetbrains.com/hc/en-us/community/posts/360007199739/comments/360002405220 Is there any way to get spring run config to both generate the BuildProperties bean that my app needs while also using the SpringBoot run configuration? ... In this case, the Debug option launches the debug for the Maven process, which runs the goal - it does not launch the JVM, which is forked by this process in debug mode.