How to enable log rotation in Jenkins for weekly?

17,015

Solution 1

Job Configuration -->Discard Old Builds:

There is default Log Rotation strategy:

Jenkins log rotation

I suggest you to click the "Advanced" button to know more about this log rotation strategy.

Solution 2

Other answers here are referring to the logs generated by the individual jobs,
but if you are asking about Jenkins' main jenkins.log file (generated by the Jenkins-server),
a bug related to that was fixed on Apr-2015 -
see here:

Also, you can read more about logging in Jenkins, here:

Solution 3

It's a default Jenkins feature and you do not need a plugin to achieve what you require. Go to job config page and check the flag at "Discard old builds" (it is right under the job's description. Then select log rotation as strategy and specify the '7' as a value for 'Days to keep builds'.

Share:
17,015

Related videos on Youtube

jass
Author by

jass

Updated on August 23, 2022

Comments

  • jass
    jass over 1 year

    I am trying to enable the log rotation for jenkins. Because the log file occupied more memory space. Is there any plugins or method to do it?

  • Ian W
    Ian W over 4 years
    OP asked about Jenkins system logs, not the job logs.