Include log4j.xml in Project Jar
Does anyone know how I can bundle my log4j.开发者_开发知识库xml file when I build my project Jar and how I can load the file at run time? Thanks in advance.
You can put a log4j.xml in a jar just like any other file, and it's loaded according to Log4J's initialization rules.
To be precise, you should put your log4j.xml file to default package in your JAR file.
精彩评论