Java 如何在运行 Spring Boot 应用程序时显示自动配置报告
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/47101743/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to display auto-configuration report when running a Spring Boot application
提问by robbie70
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled
启动 ApplicationContext 时出错。要显示自动配置报告,请在启用“调试”的情况下重新运行您的应用程序
I am getting the above message when I try to run my Spring Boot application.
当我尝试运行 Spring Boot 应用程序时收到上述消息。
Does anyone know how I can re-run the application with 'debug' enabled?
有谁知道如何在启用“调试”的情况下重新运行应用程序?
I am running the application in Intellij (version 2016.1.2)
我正在 Intellij 中运行该应用程序(版本 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,
针对 Darren 在下面的回答,我修改了我的 properties.yml 文件如下,并生成了自动配置报告,
debug: true
spring:
application:
name: xxxMyLoaderApp
cloud:
config:
uri: http://my-host.address.com:8761/config
采纳答案by Darren Forsythe
Set debug = true
or debug: true
in your properties/yml. It can also be passed as an argument --debug
.
设置debug = true
或debug: true
在您的属性/yml 中。它也可以作为参数传递--debug
。
回答by Hearen
There are lots of properties you can refer to in common-application-properties, when configuring the properties.
在配置属性时,您可以在common-application-properties 中引用许多属性。
# ----------------------------------------
# CORE PROPERTIES
# ----------------------------------------
debug=false # Enable debug logs.
trace=false # Enable trace logs.
回答by Lu55
Set logging.level.org.springframework.boot.autoconfigure
property to DEBUG
in your application's YAML/settings file. This would be enough.
套装logging.level.org.springframework.boot.autoconfigure
属性DEBUG
在应用程序的YAML /设置文件。这样就足够了。