Created
August 19, 2014 15:36
-
-
Save ysb33r/68ba7ad1279d0492086a to your computer and use it in GitHub Desktop.
HOWTO control logging running tests from Gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IN the build.gradle file | |
test { | |
systemProperties 'logback.configurationFile' : new File(projectDir,'src/test/resources/logback-test.xml').absolutePath | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Place this file in src/test/resources --> | |
<configuration> | |
<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> | |
<!-- control the level of output here --> | |
<root level="info"> | |
<appender-ref ref="STDOUT" /> | |
</root> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It looks like it does not work in fresh versions of gradle https://discuss.gradle.org/t/logback-xml-versus-gradle-build/340