56

Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled

I am getting the above message when I try to run my Spring Boot application.

Does anyone know how I can re-run the application with 'debug' enabled?

I am running the application in Intellij (version 2016.1.2)

My runner class looks like the following,

@Slf4j
@EnableIntegration
@EnableLoaderApplication
@SpringBootApplication
public class LoaderApplicaton {

    public static void main(final String[] args) {
        SpringApplication.run(LoaderApplicaton.class, args);
    }
}

In response to Darren's answer below, I amended my properties.yml file as follows and that produced the auto-configuration report,

debug: true
spring:
  application:
    name: xxxMyLoaderApp
  cloud:
    config:
      uri: http://my-host.address.com:8761/config

5 Answers 5

74

Set debug = true or debug: true in your properties/yml. It can also be passed as an argument --debug.

There are further details available in the Spring Boot documentation on what the debug flag does.

https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-logging-console-output

4
  • 2
    thanks Darren - would that be under the tree ? spring: application:
    – robbie70
    Nov 3, 2017 at 18:02
  • thanks Darren, I think that's worked as the application starts I now see more messages and DEBUG instead of INFO - the only problem is I am still seeing the message a bit later on in the start-up process and showing INFO messages not DEBUG. Could it be that another process is starting ? any idea how to trace that ? ---- Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled. 2017-11-03 18:10:04.590 ERROR 7700 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
    – robbie70
    Nov 3, 2017 at 18:12
  • 5
    the debug switch and debug logging are different. you can switch the logging by logging properties. the debug switch/property pertains to autoconfiguration reports. Changing logging should be done under the logging.level property and pick the packages w./ the levels you want to set Nov 3, 2017 at 18:16
  • 1
    this didn't work for me. Adding it into my yml file does not generate the report, spring prints the same error message as if it doesn't recognize the variable as being set in the config.
    – alex
    Mar 4, 2021 at 0:58
32

In Run/Debug Configurations check "Enable debug output"

enter image description here

3
  • 4
    This answer should clearly state which IDE is valid for.
    – lrkwz
    Jun 20, 2019 at 12:43
  • 12
    With the best IDE : Intellij
    – FBH
    Jun 21, 2019 at 9:11
  • 7
    @lrkwz The question is for intellij-idea as can be seen in the OP's tags. Jul 2, 2019 at 23:22
7

Set logging.level.org.springframework.boot.autoconfigure property to DEBUG in your application's YAML/settings file. This would be enough.

6

There are lots of properties you can refer to in common-application-properties, when configuring the properties.

# ----------------------------------------
# CORE PROPERTIES
# ----------------------------------------
debug=false # Enable debug logs.
trace=false # Enable trace logs.
0
4

As I leant on it at Baeldung lecture, the debug report on autoconfigured beans displayed on Console by putting below line in "application.properties" file:

logging.level.org.springframework.boot.autoconfigure=DEBUG

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.