I am trying to add commons-logging.properties
to the classpath to be picked up by commons-logging.1.1.3.jar
which uses JDK14Logger by default and then print DEBUG logs.
When I added this under /src folder (a normal Java project),it was picked up when Run As -> Java Application.
However, for a Maven project,I tried placing this file at various places "src/main/java", "src/main/resources", under the root of the project. It wasn't considered when Run As -> Java Application.
Only when explicitly specified through a VM argument like the following, the log config file was picked up:
-Djava.util.logging.config.file=C:\ws-learning\spring-tutorial-5\commons-logging.properties
What is a classpath for a maven project?
Where should I place the config file to be picked up?
Why src/ and src/main/java behaves differently with respect to classpath?
UPDATE:
Only "INFO" level messages are printed. I don't see "FINE" level messages
handlers=java.util.logging.ConsoleHandler,java.util.logging.FileHandler
.level=SEVERE
org.springframework.level=FINE
java.util.logging.ConsoleHandler.level=ALL
java.util.logging.FileHandler.level=FINE
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter
UPDATE 2:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>