我是Spring Boot的初学者,而log4j配置,我试图运行我的Spring启动项目,但是我收到了这条消息错误: 我试图更改RollingFile_Appender,但我得到了相同的消息。
任何机构都可以帮我解决 PS:我正在使用log4j,spring boot,
2018-05-22 11:00:28,653 main ERROR Null object returned for RollingFile in Appenders.
2018-05-22 11:00:28,661 main ERROR Unable to locate appender "RollingFile_Appender" for logger config "root"
2018-05-22 11:00:28,662 main ERROR Unable to locate appender "RollingFile_Appender" for logger config "org.hibernate.SQL"
2018-05-22 11:00:28,663 main ERROR Unable to locate appender "RollingFile_Appender" for logger config "es.aragon.radac"
文件内容:
# https://dzone.com/articles/log4j-2-configuration
Configutation:
name: Default
Properties:
Property:
name: log-path
value: "/logs/app/radac/"
Appenders:
Console:
name: Console_Appender
target: SYSTEM_OUT
PatternLayout:
pattern: "[%d %-5level] %logger -> %method : %msg%n"
RollingFile:
- name: RollingFile_Appender
fileName: ${log-path}/radac.log
filePattern: "${log-path}/archive/radac.log.%d{yyyy-MM-dd}"
PatternLayout:
pattern: "[%d %-5level] %logger -> %method : %msg%n"
Policies:
TimeBasedTriggeringPolicy:
interval: 1
modulate: true
DefaultRollOverStrategy:
Delete:
basePath: ${log-path}/archive/
maxDepth: 1
IfFileName:
glob: radac.log.*
IfLastModified:
age: 3d
Loggers:
Root:
level: error
additivity: false
AppenderRef:
- ref: Console_Appender
level: debug
- ref: RollingFile_Appender
level: debug
- name: org.hibernate.SQL
level: all
additivity: false
AppenderRef:
- ref: Console_Appender
level: debug
- ref: RollingFile_Appender
level: debug
- name: es.aragon.radac
level: all
additivity: false
AppenderRef:
- ref: Console_Appender
level: debug
- ref: RollingFile_Appender
level: debug