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:
parent
9229ed98e2
commit
ffd2450e11
11
common/src/test/resources/logback-test.xml
Normal file
11
common/src/test/resources/logback-test.xml
Normal 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>
|
6
pom.xml
6
pom.xml
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user