How to configure log4j in a java project that does not have the src folder?

0

I have a Java project that does not have the src (8z!) folder and I need to use log4j, I created the log4j.properties file and inserted it into the main package (com.meuproj.main), but the log file is not created when it generates the application executable.

I'm using log4j 1.2.17

    
asked by anonymous 05.04.2017 / 15:05

1 answer

0

The file is loaded by log4j as a resource, so it is searched in subdirectories that are in the classpath. In Eclipse and in build tools like Maven and Gradle, the font folder (usually src) is added to the classpath, which is why the file is found by log4j. Then the answer is : put the Loj4J configuration file in any folder of your project that is part of the CLASSPATH.

link

    
05.04.2017 / 15:47