当前位置: 首页 > 知识库问答 >
问题:

“debug=true”和“logging.level.root=debug”之间的Spring Boot属性差异`

章越
2023-03-14

debug=truelogging.level.root=debug之间有什么区别吗,两者都在Spring启动应用程序application.properties文件中指定。

下面是Spring靴留档的参考资料,不幸的是,它们之间没有显示任何联系,但看起来它们有相同的用途。

https://docs.spring.io/spring-boot/docs/2.6.6/reference/htmlsingle/#features.logging.console-输出

https://docs.spring.io/spring-boot/docs/2.6.6/reference/htmlsingle/#features.logging.log-levels

共有1个答案

殷承恩
2023-03-14

当您设置debug=true时,spring boot在后台使用的一堆“核心”记录器将被设置为debug:web容器(像html" target="_blank">tomcat)、spring boot本身、hibernate。

不过,这不会影响应用程序的记录器-它们仍然处于信息严重性级别。

但是,如果您设置类似于logging.level的内容。root=debug可能所有的记录器都将设置为debug,所以是的,技术上是有区别的。

从spring boot文档中:

启用调试模式后,将选择核心记录器(嵌入式容器、Hibernate和Spring Boot)配置为输出更多信息。启用调试模式不会将您的应用程序配置为以DEBUG级别记录所有消息。

 类似资料:
  • Attribute Name Type Required Default Description output string No html output type, html or javascript 属性 类型 是否必须 缺省值 描述 output string No html 输出类型,html或javascript {debug} dumps the debug console to t

  • The debug component enables component-to-DOM serialization. Example < a-scene debug> </ a-scene> Com

  • 在本章中,我们将研究Joomla中的Debug 。 通过启用调试模式,它有助于解决Joomla的各种问题。 它显示了Joomla如何呈现会话数据,配置文件信息,内存使用和数据库查询的详细信息。 Joomla调试 以下是用于设置Joomla调试的简单步骤。 Step (1) - 进入System → Global Configuration ,如下面的屏幕所示。 接下来,单击Joomla Globa

  • Debug 输入sql语句,但不执行debug() Return: 开启Medoo调试模式 输出sql语句,不需要使用echo或其它方法。调试完成请移除此代码 $database->debug()->select("bccount", [ "user_name", "email"], [ "user_id[ 20]);// Will output:// SELECT "user_

  • Debug 输入sql语句,但不执行debug() Return: 开启Medoo调试模式 输出sql语句,不需要使用echo或其它方法。调试完成请移除此代码 $database->debug()->select("bccount", [ "user_name", "email"], [ "user_id[ 20]);// Will output:// SELECT "user_

  • debug 提供简单的辅助debug功能。