I checked the documentation of log4j and the properties file must be in the path.
Particularly I use this code to configure it:
private static final File LOG_PROPS = new File("logger.properties");
...
if (LOG_PROPS.exists()) {
PropertyConfigurator.configure(LOG_PROPS.getPath());
} else {
BasicConfigurator.configure();
}
While the logger.properties file is in the directory where the application executes, it works well.
