How to enable log rotation in Jenkins for weekly?

2020-06-16 04:50发布

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?

3条回答
贼婆χ
2楼-- · 2020-06-16 05:18

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:

查看更多
仙女界的扛把子
3楼-- · 2020-06-16 05:18

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'.

查看更多
淡お忘
4楼-- · 2020-06-16 05:23

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.

查看更多
登录 后发表回答