In this lesson, we’ll explore how to create and configure loggers in Jenkins for effective troubleshooting and debugging using the Log Recorder. You can choose one of the following methods to adjust logging levels:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
| Approach | Method | Persistence |
|---|---|---|
| 1 | Add a logger from the UI (recommended) | Permanent |
| 2 | Run a Groovy script during Jenkins initialization | Permanent |
| 3 | Supply a logging.properties file in $JENKINS_HOME/logging.properties | Permanent |
| 4 | Place a logger configuration file in the $JENKINS_HOME/logs directory | Permanent |
| 5 | Configure default levels via the UI (non-persistent) | Session only (resets after restart) |
Increasing log verbosity can generate large volumes of data and impact the Jenkins controller’s performance. Enable higher log levels only during active troubleshooting, then revert to defaults or remove the custom logger.
Examples: Non-UI Configuration
Below are two configuration examples for approaches 3 and 5.1. logging.properties File (Approach 3)
Create a logging.properties file under $JENKINS_HOME/logging.properties:
2. Default Levels via UI (Non-Persistent, Approach 5)
If you add default levels through the Jenkins UI (which does not survive a restart), use this XML snippet:1. Adding a Logger from the UI
The most straightforward method to configure logging is via the Jenkins web interface:- Go to Manage Jenkins → System Log.
- Click Add new log recorder.
- Enter a meaningful name, e.g.,
example-logs. - Under Log Levels, select the severity (ALL, FINE, FINEST, etc.).
- In the Loggers section, add one or more package or class names (for example,
io.fabric8.kubernetes.client). - Click Save.

2. Use Case: Capturing Logs for a Kubernetes Cloud
When Jenkins is integrated with a Kubernetes cloud, a simple Test Connection might fail due to insufficient permissions:- Navigate to Manage Jenkins → System Log.
- Click Add new log recorder, name it
k8s-logs. - Under Log Levels, set ALL (or another desired level).
- In Loggers, search for
kubernetesand selectio.fabric8.kubernetes.client(or a specific sub-package). - Click Save.

k8s-logs recorder. You should see detailed HTTP traffic:

After you finish debugging, remember to delete or disable any custom log recorders to avoid excessive log generation and performance degradation.