Configure Loggers for Jenkins


  • I want to adjust the log levels in Jenkins for specific packages / classes



There are different ways of configuring the logging level of Jenkins loggers. This article describe some of them.

Solution 1: use a post initialization script:

Jenkins provides a way to run groovy script during initialization: Post-initialization script. So you can create a script that set the logging levels appropriately on startup. For example, the following script set the level of and hudson.plugins.git.GitStatus to the SEVERE level:

import java.util.logging.Level
import java.util.logging.Logger


Solution 2: use java.util.logging

Create a file in which you define the logging levels and a ConsoleHandler. Then pass this file to the JVM by adding the system property -Djava.util.logging.config.file=<pathTo>/ A file like the following would apply the same configuration as in Solution 1:

.level = INFO
handlers= java.util.logging.ConsoleHandler

java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter = SEVERE
hudson.plugins.git.GitStatus.level = SEVERE

See the Java Logging Overview for more details about this method.

(Note: This solution works for classes that use java.util.logging. For classes that use a different implementation - for example org.apache.commons.logging - the level will not be changed)

Solution 3: From the Jenkins UI

You can set the logging level of the Loggers under Manage Jenkins > System Logs > Log Levels. Simply copy/paste the logger or package you want to adjust the level for, select the logging Level and click on Submit. For example, the following matches the same configuration as in Solution 1::

(Note: This solution does not survive a restart)


For more information about Jenkins logging and loggers, please have a look at the following articles:

Have more questions?


Please sign in to leave a comment.