Add logging configuration to pom.xml

Motivation:
Currently the default log level when running tests is debug. When
running the build on the CI server it might be nice to avoid this debug
level and allow for the level to be configured.

Modifications:
Added a logback-test.xml configuration that has been added to the
common module. This allows for the logLevel to be configured.
The default level will still be debug.

Result:
The log level can now be configured from the command line:
$ mvn test -DlogLevel=error
This commit is contained in:
Daniel Bevenius 2016-04-12 09:47:59 +02:00 committed by Norman Maurer
parent 9229ed98e2
commit ffd2450e11
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<configuration debug="false">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="${logLevel:-info}">
<appender-ref ref="STDOUT" />
</root>
</configuration>

View File

@ -227,6 +227,8 @@
<tcnative.version>1.1.33.Fork15</tcnative.version>
<tcnative.classifier>${os.detected.classifier}</tcnative.classifier>
<epoll.classifier>${os.detected.name}-${os.detected.arch}</epoll.classifier>
<logging.config>${project.basedir}/../common/src/test/resources/logback-test.xml</logging.config>
<logging.logLevel>debug</logging.logLevel>
</properties>
<modules>
@ -807,6 +809,10 @@
<exclude>**/TestUtil*</exclude>
</excludes>
<runOrder>random</runOrder>
<systemPropertyVariables>
<logback.configurationFile>${logging.config}</logback.configurationFile>
<logLevel>${logging.logLevel}</logLevel>
</systemPropertyVariables>
<argLine>${argLine.common} ${argLine.alpnAgent} ${argLine.leak} ${argLine.coverage} ${argLine.noUnsafe}</argLine>
<properties>
<property>