views:

82

answers:

2

Hi,

I'm unable to adjust java logging's logging level. I'm using maven surefire (mvn test), and trying to adjust from the default INFO to e.g. FINEST.

I have logging.properties file under src/test/resources/logging.properties

after compile, i see under target/test-classes, i see a logging.properties file with the intended config:

java.util.logging.ConsoleHandler.level=FINEST

javax.enterprise.system.container.ejb.level=FINE

...

however the console output from glassfish only have INFO / SEVERE level messages.

Where did I go wrong? or is this another pain in the butt thing with maven?

A: 

Looks like its not possible yet under maven?:

http://jira.codehaus.org/browse/MNG-2570

Also when I setup the pom to use a custom java.util.logging properties file as follows:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>2.4.2</version>
  <configuration>
    <systemProperties>
      <property>
        <name>java.util.logging.config.file</name>
        <value>${project.build.directory}/test-classes/logging.properties</value>
      </property>
    </systemProperties>
   ...

logging disappears...

Dzhu
+1  A: 

You need to specifiy your handlers in the logging file

handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler

then it should work

martin
awesome, its working now thank you. How did I miss that?????
Dzhu