properties文件仍然有错误

log4j:WARN Failed to set property [filter] to value "org.apache.log4j.varia.LevelRangeFilter". 
log4j:ERROR Could not instantiate class [FATAL].

后来我在国外论坛上找到了答案

The PropertyConfigurator does not handle the advanced configuration features supported by the DOMConfigurator such as support for Filters, custom ErrorHandlers, nested appenders such as the AsyncAppender, etc.

 

翻译如下:

PropertyConfigurator 不能处理那些DOMConfigurator支持的高级配置功能,例如过滤器支持、自定义错误处理器、嵌套Appender(例如AsyncAppender)等等

 

看来xml配置才是log4j的王道。果然换了xml配置就可以使用了。

参考地址:http://stackoverflow.com/questions/1257641/cant-set-levelrangefilter-for-log4j

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-26
  • 2021-07-28
  • 2021-07-09
  • 2021-08-13
  • 2021-10-14
  • 2021-09-14
猜你喜欢
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-12-25
相关资源
相似解决方案