log4j 初始化期间的 log4j 日志消息
我试图设置 log4j(基于 xml)配置,使用 LevelRangeFilter,如官方网站。到目前为止一切都很好,除了 log4j 在初始化之前会吐出自己的日志消息。在'完成配置'行之后,一切正常。此外,还有一个错误,指出“log4j:找不到根记录器信息。这样可以吗?”。
谢谢。
log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j: Level value for root is [all].
log4j: root level set to ALL
log4j: Class name: [org.apache.log4j.FileAppender]
log4j: Setting property [file] to [logs/debug.log].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [[%d{ISO8601}] %-5p %c %m %n].
log4j: Setting property [levelMax] to [DEBUG].
log4j: Setting property [levelMin] to [DEBUG].
log4j: Setting property [acceptOnMatch] to [true].
log4j: Adding filter of type [class org.apache.log4j.varia.LevelRangeFilter] to appender named [debug-out].
log4j: setFile called: logs/debug.log, true
log4j: setFile ended
..................
...................
log4j: Adding appender named [error-out] to category [root].
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Setting property [target] to [System.err].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [[%d{ISO8601}] %-5p %c %m %n].
log4j: Setting property [levelMin] to [INFO].
log4j: Setting property [levelMax] to [FATAL].
log4j: Adding filter of type [class org.apache.log4j.varia.LevelRangeFilter] to appender named [console].
log4j: Adding appender named [console] to category [root].
log4j: Reading configuration from URL file:/C:/Work/test/conf/log4j.xml
log4j: Could not find root logger information. Is this OK?
log4j: Finished configuring.
I was trying to setup log4j (xml based) configuration, Use LevelRangeFilter, as described in the official site. Everything is fine so far, except log4j spit out its own log messages till it initializes. After the 'finished configuration' line, everything is normal. Also, there is an error stating "log4j: Could not find root logger information. Is this OK?" .
thanks.
log4j: reset attribute= "false".
log4j: Threshold ="null".
log4j: Level value for root is [all].
log4j: root level set to ALL
log4j: Class name: [org.apache.log4j.FileAppender]
log4j: Setting property [file] to [logs/debug.log].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [[%d{ISO8601}] %-5p %c %m %n].
log4j: Setting property [levelMax] to [DEBUG].
log4j: Setting property [levelMin] to [DEBUG].
log4j: Setting property [acceptOnMatch] to [true].
log4j: Adding filter of type [class org.apache.log4j.varia.LevelRangeFilter] to appender named [debug-out].
log4j: setFile called: logs/debug.log, true
log4j: setFile ended
..................
...................
log4j: Adding appender named [error-out] to category [root].
log4j: Class name: [org.apache.log4j.ConsoleAppender]
log4j: Setting property [target] to [System.err].
log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
log4j: Setting property [conversionPattern] to [[%d{ISO8601}] %-5p %c %m %n].
log4j: Setting property [levelMin] to [INFO].
log4j: Setting property [levelMax] to [FATAL].
log4j: Adding filter of type [class org.apache.log4j.varia.LevelRangeFilter] to appender named [console].
log4j: Adding appender named [console] to category [root].
log4j: Reading configuration from URL file:/C:/Work/test/conf/log4j.xml
log4j: Could not find root logger information. Is this OK?
log4j: Finished configuring.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 XML 配置
log4j.xml
中:将
debug
属性设置为false
。快乐的记录:-)
In the XML configuration
log4j.xml
:set the
debug
attribute tofalse
.Happy logging :-)
您应该添加类似于 .xml 文件的内容。
You should add something similar to your .xml file.