Viewing logs

Logs on the system

When running jenkins.war manually with java -jar jenkins.war, all logging information by default is output to standard out. Many Jenkins native packages modify this behavior to ensure logging information is output in a more conventional location for the platform.

Linux

By default logs should be made available in /var/log/jenkins/jenkins.log, unless customized in /etc/default/jenkins (for *.deb) or via /etc/sysconfig/jenkins (for */rpm)

Windows

By default logs should be at %JENKINS_HOME%/jenkins.out and %JENKINS_HOME%/jenkins.err, unless customized in %JENKINS_HOME%/jenkins.xml

Mac OS X

Log files should be at /var/log/jenkins/jenkins.log, unless customized in org.jenkins-ci.plist.

Docker

If you run Jenkins inside docker as a detached container, you can use docker logs containerId to view the Jenkins logs.

Logs in Jenkins

Jenkins uses java.util.logging for logging. The java.util.logging system by default sends every log above INFO to stdout.

Jenkins is equipped with a GUI for configuring/collecting/reporting log records of your choosing. This page shows you how to do this.

First, select the "System Log" from the "Manage Jenkins" page:

Manage Jenkins

From there, you can create a custom log recorder, which helps you group relevant logs together while filtering out the noise.

Log Recorders

Choose a name that makes sense to you.

Enter log recorder name

You’ll be then asked to configure loggers and their levels whose output you’d like to collect. Depending on which part of Jenkins you monitor, you’ll need to specify different loggers. Tell us the symptom of your problem in the users list and we should be able to tell you where you need to look. Also, this is really just a wrapper around the java.util.logging package, so if you program in Java, you might be able to guess where to look.

Specify loggers

Once the set up is complete, Jenkins will start collecting data. The collected logs are available from the web UI.

Making custom logs available outside of the web UI

The simplest solution is to install the Support Core Plugin, which causes custom logs to be written to disk automatically.

Debug logging in Jenkins

Create a file logging.properties 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>/logging.properties. In the logging.properties file please add the below line:

logging.properties

.level=TRACE


Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.