Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
HOWTO control logging running tests from Gradle
// IN the build.gradle file
test {
systemProperties 'logback.configurationFile' : new File(projectDir,'src/test/resources/logback-test.xml').absolutePath
<!-- Place this file in src/test/resources -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
<!-- control the level of output here -->
<root level="info">
<appender-ref ref="STDOUT" />

This comment has been minimized.

Copy link

@Hubbitus Hubbitus commented Nov 1, 2018

It looks like it does not work in fresh versions of gradle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment