log4j.properties vs log4j.xml

前端 未结 2 1092
甜味超标
甜味超标 2020-12-23 18:04

I was asked to move from properties style configuration to xml style. The process itself is straightforward and it is not causing me any trouble, I was simply curious why I

2条回答
  •  再見小時候
    2020-12-23 18:12

    As per FrVaBe's answer, the PropertyConfigurator class does not handle the advanced features that XML can support.

    It's worth noting one of the more useful advanced options (only available log4j.xml) is the ability to filter on a specific log level or range of log levels using LevelMatchFilter and DenyAllFilter

    A good example can be seen here.

提交回复
热议问题