Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop Jenkins log from becoming huge?

Tags:

jenkins

Recently my jenkins.log has started getting very large, very quickly, full of exceptions about DNS resolution. I attempted to use logrotate, but the log file grows too quickly even to be rotated, and just eats up all my disk space, which then causes various services to fail because they cannot write files anymore.

How do I avoid that?

like image 561
Matthieu Wipliez Avatar asked Jul 30 '15 09:07

Matthieu Wipliez


People also ask

How do I change the log level in Jenkins?

If you want to change the default/package log level temporally you have to go to Manage Jenkins > System Log > Log Levels and set the level that you want. The logger with no name is the default logger. All the loggers without a configured level inherit the level of the default logger.

How do I clear Jenkins logs?

Go to your Jenkins home page -> Manage Jenkins -> Script Console. Run this script to clean and reset. Copy and paste this script to your Console Script text area and change the "copy_folder" to the project name that you need to clean the history. Then click the Run button.

Where are Jenkins log files stored?

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

How do I enable debug logs in Jenkins?

Typically, you would use the GUI for viewing the logs, which is why it had that effect; however, if you want something the GUI doesn't provide (such as better information of what is going on with a slave), you may have to look to the container you're running Jenkins in, review the logging config, set it to debug, and ...


1 Answers

You can disable the logging of these DNS errors by adjusting the logging settings within Jenkins.

From the Jenkins web interface go to:

 Manage Jenkins -> System Log -> Log Levels (on the left) 

Add the following entry:

Name: javax.jmdns  Level: off 

This way you can keep the Multicast DNS feature but without all the logging data.

like image 161
Neil P Avatar answered Sep 19 '22 20:09

Neil P