How to set java.util.logging log level in maven (for Jenkins plugin tests (JenkinsRule))

I am writing a Jenkins plugin and testing it with mvn verify and JenkinsRule . So far so good, but I would like to be able to calm the exit; these are pages per test. What configuration file do I use and where to put it?

I tried the appropriate log4j.properties (and, of course, logging.properties) in src / test / resources (and therefore the target / test classes); I tried to put them in the target / jenkins-for-test / WEB-INF / classes which didn't help either.

In the event that it runs through any memory, the conclusion I'm trying to suppress is things like

 Feb 08, 2014 2:26:40 PM jenkins.InitReactorRunner$1 onAttained INFO: Started initialization Feb 08, 2014 2:26:40 PM jenkins.InitReactorRunner$1 onAttained INFO: Listed all plugins 

and

 Feb 08, 2014 2:26:44 PM hudson.PluginWrapper stop INFO: Stopping javadoc Feb 08, 2014 2:26:44 PM hudson.PluginWrapper stop INFO: Stopping maven-plugin 
+8
java maven jenkins jenkins-plugins java.util.logging
source share
1 answer

Check this topic: Logging level in maven surefire

There are a few things you can try. First, specify the handlers in the logging.properties file by adding this line:

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

Secondly, you can add the location of logging.properties to your pom.xml, for example:

 <plugins> <plugin> <artifactId>maven-surefire-plugin</artifactId> <configuration> <systemProperties> <property> <name>java.util.logging.config.file</name> <value>src/test/resources/logging.properties</value> </property> </systemProperties> </configuration> </plugin> </plugins> 

Good luck

+4
source share

All Articles