- How do I create a logger?
- How can I get more detailed diagnostic information?
- CloudBees Core
- CloudBees Core on modern cloud platforms - Managed Master
- CloudBees Core on modern cloud platforms - Operations Center
- CloudBees Core on traditional platforms - Client Master
- CloudBees Core on traditional platforms - Operations Center
- CloudBees Jenkins Enterprise
- CloudBees Jenkins Enterprise - Managed Master
- CloudBees Jenkins Enterprise - Operations Center
- CloudBees Jenkins Platform - Client Master
- CloudBees Jenkins Platform - Operations Center
- CloudBees Jenkins Distribution
- Jenkins LTS
To view logs from a specific action exposed by Jenkins, or a plugin not typically monitored, you can add a logger under
Manage Jenkins -> System Log -> Add new log recorder
To add a new logger you will be asked to provide it a name and choose a function to monitor. You’ll also have the ability to change the verbosity.
To find what loggers are available you can simply start typing a keyword. For instance, typing ‘git’ will provide you with a list of loggers that may be relevant. You can also look at the source code for Jenkins and its plugins to identify class names which you can get logs from.
After saving the log recorder, there are two ways to see the resulting log entries. One is to refresh the log recorder’s page. Logs will only be displayed there while the page is open. If you need to manipulate the Jenkins UI in order to trigger the logging you want to see, you would need to do that in a separate tab or window while continuing to view the log recorder page. The other way to observe these logs is to install the Support Core plugin. When Support Core is installed, custom log recorders will write to
$JENKINS_HOME/logs/custom/ on the Jenkins master’s filesystem. You can then
tail the relevant file to see updates to it. (Jenkins 2.114 introduced a system property which allows you to specify a different location to store Jenkins logs. Support Core plugin 2.47 supports this, so you may need to check if that property has been set if you are not seeing logs in the default location.)
Finally, it is recommended that you remove any log recorders you have added once they are no longer needed. Depending on how much data they are capturing, they can have a significant impact on Jenkins’s performance.