Loggers

Spring Boot 执行器包括以运行时查看和配置应用程序日志级别功能。您可以查看整个列表或单个日志记录器的配置,该配置由显式配置的日志记录级别以及日志记录框架提供给它的有效日志记录级别组成。这些级别可能是:

Spring Boot Actuator includes the ability to view and configure the log levels of your application at runtime. You can view either the entire list or an individual logger’s configuration, which is made up of both the explicitly configured logging level as well as the effective logging level given to it by the logging framework. These levels can be one of:

  • TRACE

  • DEBUG

  • INFO

  • WARN

  • ERROR

  • FATAL

  • OFF

  • null

null”表示没有显式配置。

null indicates that there is no explicit configuration.

Configure a Logger

若要配置给定的日志记录器,“POST”部分实体到资源的 URI,如下例所示:

To configure a given logger, POST a partial entity to the resource’s URI, as the following example shows:

{
	"configuredLevel": "DEBUG"
}

若要““reset””日志记录器的特定级别(并改用默认配置),可以将值“null”作为“configuredLevel”传递。

To “reset” the specific level of the logger (and use the default configuration instead), you can pass a value of null as the configuredLevel.