开发者

Multiple log4j xml files for multiple applications

I have 5 applications which have different log4j xml configuration file. And I w开发者_运维百科ant each of them to be configured according to the given file and logs correctly when called from one main method.


Log4j will automatically look for and use config files it finds on the classpath. It looks for files called log4j.properties and log4j.xml and possibly others.

Alternatively you can programatically load config using;

String filename = "/path/to/config/file.xml";
DOMConfigurator.configure(filename);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜