Where to place log4j.xml

前端 未结 6 749
滥情空心
滥情空心 2020-11-30 02:37

How can we specify were log4j has to look at when trying to find its xml configuration file ?

It seems that by default, log4j looks into the root of a class folder,

6条回答
  •  难免孤独
    2020-11-30 03:02

    Suppose your log4j configuration is outside the source tree. If it can't find your configuration file, help it with:

    -Dlog4j.configuration=file:///your/path/log4j.xml
    

    Note the qualifier file:///. It won't work without.

提交回复
热议问题