简体   繁体   English

具有调试模式但禁用自动配置报告的 Spring Boot

[英]Spring boot with debug mode but disabled autoconfig report

I would like to use the debug=true flag when running my spring boot applications during development, but I do not want it to print the autoconfiguration report every time I start the application because I am not changing my spring configuration all the time and it should be enough to only look at the autoconfiguration report when I actually need to make some modifications to the auto configuration.我想在开发过程中运行我的 spring 启动应用程序时使用debug=true标志,但我不希望它每次启动应用程序时都打印自动配置报告,因为我没有一直更改我的 spring 配置,它应该当我真正需要对自动配置进行一些修改时,只查看自动配置报告就足够了。

Is there a way to deactivate the autoconfig report in a spring boot application but at the same time keep the debug flag such that debug message are still printed in log output?有没有办法在 spring 启动应用程序中停用自动配置报告,但同时保留调试标志,以便调试消息仍打印在日志输出中?

Take a look at this section of Spring Boot docs .查看Spring Boot 文档的这一部分 You can define debug logging only for certain packages of your app:您只能为应用程序的某些包定义调试日志记录:

logging.level.root=WARN
logging.level.org.springframework.web=ERROR
logging.level.org.hibernate=ERROR
logging.level.your.package=DEBUG

This way Spring and Spring Boot debug outputs are not printed and you can see only your debug outputs.这样就不会打印 Spring 和 Spring Boot 调试输出,您只能看到调试输出。 Running Spring Boot with debug mode is very noisy and slows down your development a lot.在调试模式下运行 Spring Boot 非常嘈杂,并且会大大减慢您的开发速度。 Do that only if you are troubleshooting Spring related issues.只有在您对 Spring 相关问题进行故障排除时才这样做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM