Spring 引导:"Cannot set level: INFO, ERROR for 'org.springframework'" 使用 logback-spring.xml
Spring Boot : "Cannot set level: INFO, ERROR for 'org.springframework'" using logback-spring.xml
我的应用程序是 运行 in V 1.5.10.RELEASE,为了跟踪我在文件中的日志,我基本上使用了 logback-spring.xml
当处理程序捕获并抛出 "message" 类型的异常时:"java.lang.NullPointerException"
错误被严重重组:
{
"timestamp": "2019-11-12T10:59:58.124Z",
"timeZone": "Europe/Paris",
"level": "ERROR",
"env": "PRD",
"laas_apcode": "xxxx",
"laas_type": "service_logs",
"laas_retention": "quarter",
"laas_token": "0000000x",
"organizationalEntity": "xxxx",
"apName": "xxx-xxxx",
"apVersion": "0.4.9-1911",
"nodeName": "xxxx",
"labels": {
"userId": "",
"sourceIp": "",
"layer": "",
"rootCorrelationId": "",
"correlationId": "",
"parentCorrelationId": ""
},
"loggerName": "o.s.b.logging.LoggingApplicationListener",
"message": "Cannot set level: INFO, ERROR for 'org.springframework'",
"exception": {
"stackTrace": ""
}
}
在我的 application.yml 中,我设置为:
# Logging Configurations
logging:
level:
ROOT: WARN
org.springframework: INFO, ERROR
不允许在一个包裹上设置多个级别
# Logging Configurations
logging:
level:
ROOT: WARN
org.springframework: INFO
这将显示包 org.springframework
级别 INFO
、WARN
、ERROR
的所有消息
以及包 your.package
的 WARN
、ERROR
级别的所有消息
我的应用程序是 运行 in V 1.5.10.RELEASE,为了跟踪我在文件中的日志,我基本上使用了 logback-spring.xml
当处理程序捕获并抛出 "message" 类型的异常时:"java.lang.NullPointerException" 错误被严重重组:
{
"timestamp": "2019-11-12T10:59:58.124Z",
"timeZone": "Europe/Paris",
"level": "ERROR",
"env": "PRD",
"laas_apcode": "xxxx",
"laas_type": "service_logs",
"laas_retention": "quarter",
"laas_token": "0000000x",
"organizationalEntity": "xxxx",
"apName": "xxx-xxxx",
"apVersion": "0.4.9-1911",
"nodeName": "xxxx",
"labels": {
"userId": "",
"sourceIp": "",
"layer": "",
"rootCorrelationId": "",
"correlationId": "",
"parentCorrelationId": ""
},
"loggerName": "o.s.b.logging.LoggingApplicationListener",
"message": "Cannot set level: INFO, ERROR for 'org.springframework'",
"exception": {
"stackTrace": ""
}
}
在我的 application.yml 中,我设置为:
# Logging Configurations
logging:
level:
ROOT: WARN
org.springframework: INFO, ERROR
不允许在一个包裹上设置多个级别
# Logging Configurations
logging:
level:
ROOT: WARN
org.springframework: INFO
这将显示包 org.springframework
INFO
、WARN
、ERROR
的所有消息
以及包 your.package
WARN
、ERROR
级别的所有消息