Friday, July 24, 2009

How to locate log4j.properties file inside JAR?

If your log4j.properties file is inside a JAR file then you can tell Log4j library how to find it:

java -Dlog4j.configuration=jar:file:[path_to_jar_file]!/[path_to_properties_file_inside_jar] -jar myapp.jar

example:

java -Dlog4j.configuration=jar:file:/home/application/lib/logic.jar!/log4j.properties -jar myapp.jar

No comments: