Jalibu
Jalibu

Reputation: 21

Jenkins does not show log4j logs

my problem is that I can not see the JUnit log4j logs of my integration tests, when I run them on jenkins.

When I start them from my local eclipse everything works fine. I tried Java Utils Logging before that worked fine as well.

I tried lots of log4j.properties settings. The current one looks as follows:

# Set root category priority to INFO and its only appender to CONSOLE.
log4j.rootCategory=INFO, CONSOLE
#log4j.rootCategory=INFO, CONSOLE, LOGFILE

# Set the enterprise logger priority to FATAL
log4j.logger.org.apache.axis2.enterprise=FATAL
log4j.logger.de.hunsicker.jalopy.io=FATAL
log4j.logger.httpclient.wire.header=FATAL
log4j.logger.org.apache.commons.httpclient=FATAL

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%p] %m%n

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=axis2.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n

What am I doing wrong? The log4j.properties file is placed in /src/main/resources. As there is no No log4j appenders-warning in the log, I assume that it is in the classpath and consumed.

Upvotes: 0

Views: 1641

Answers (1)

Jalibu
Jalibu

Reputation: 21

I found the solution in Logging while testing through Gradle

The problem was in the gradle settings:

testLogging {
    events 'passed', 'failed', 'standardError'
    showStandardStreams = true
}

Upvotes: 1

Related Questions