Allow slf4j logging during junit tests


(Gadi Eichhorn) #1

I would like to see my code and test code logging in JUnit tests. I use slf4j as log wrapper.

gradle 4.2.1
junit 4

dependencies {
    compile group: 'org.slf4j', name:'slf4j-api', version: '1.7.21'
    compile group: 'org.slf4j', name:'slf4j-simple', version: '1.7.21'
    compile group: 'ch.qos.logback', name: 'logback-classic', version:  '1.1.7'

    testCompile group: 'junit', name: 'junit', version: '4.12'

this setup will only show info log level (no warn or error) ?!?

test {
    testLogging {
        showStandardStreams true
        exceptionFormat 'full'

thanks in advance.