Adding log4j configuration file in the executable jar file


Add "." to your classpath.

You can do this from the DOS console using:
set path=%path%;.

The log4j.properties file and the log4j.jar file should be in the same folder hierarchy level.

In the class which uses the logger, you can simply refer the log4j properties file as
logConfigPath="log4j.properties";

This really helps a lot.

1 comment: