lefloh
lefloh

Reputation: 10961

Configure Logging for Deltaspike Test-Control

I've CDI based test using following dependencies:

<dependency>
    <groupId>org.apache.deltaspike.modules</groupId>
    <artifactId>deltaspike-test-control-module-api</artifactId>
    <version>1.6.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.apache.deltaspike.modules</groupId>
    <artifactId>deltaspike-test-control-module-impl</artifactId>
    <version>1.6.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.apache.deltaspike.cdictrl</groupId>
    <artifactId>deltaspike-cdictrl-weld</artifactId>
    <version>1.6.0</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.jboss.weld.se</groupId>
    <artifactId>weld-se-core</artifactId>
    <version>2.2.13.Final</version>
    <scope>test</scope>
</dependency>

These are my logging.properties:

.handlers=java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS %4$-6s %2$s %5$s%6$s%n

.level=INFO
java.util.logging.ConsoleHandler.level=INFO

When running a test I have these log messages:

2016-04-24 11:10:32 INFORMATION org.apache.deltaspike.core.util.ProjectStageProducer initProjectStage Computed the following DeltaSpike ProjectStage: Production
2016-04-24 11:10:33 INFORMATION org.apache.deltaspike.core.api.config.PropertyLoader loadAllProperties could not find any property files with name META-INF/apache-deltaspike_test-container
2016-04-24 11:10:34 INFORMATION org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener testStarted [run] com.foo.Bar#someMethod
2016-04-24 11:10:34 INFORMATION org.apache.deltaspike.testcontrol.api.junit.CdiTestSuiteRunner$LogRunListener testFinished [finished] com.foo.Bar#someMethod

I don't need these messages so I added following configuration to my logging.properties:

org.apache.deltaspike.level=WARNING

Now the first two lines are gone. How can I get rid of the CdiTestSuiteRunner$LogRunListener messages?

Note: I can get rid of these messages with following configuration:

java.util.logging.ConsoleHandler.level=WARNING

But that's oviously not what I want.

Upvotes: 2

Views: 1291

Answers (1)

Related Questions