I use Hudson as well as Jenkins and I have several jobs on them. From time to time my hudson.log/jenkins.log file grows enormously.
I am aware that the size of same can be limited. Please help in how to change and in what file the change has to be made.
You can use
logrotate
. You can find more information aboutlogrotate
on this kb article.Here is how
logrotate
is configured on my system (/etc/logrotate.d/jenkins
):or if you don't really like signals, and it is crashing jenkins for you, you can use the logrotate definition from this debian config.
Using logrotate with copytruncate does not release the lock for the file descriptor and you end up with issues like the one mentioned by Sebastian Sastre, where rotation happens but you won't get your disk space back until you restart Jenkins.
As an alternative solution this script perhaps could be used in the postrotate block. It relies on gdb to send a close() open() replacing the "broken" file descriptor.