Why is my Jenkins access log empty?

Article ID:204465130
1 minute readKnowledge base

Issue

  • Only on the day of the restart the jenkins log is created. After the first log rotate is empty.

  • Jenkins access_log stays empty after logrotate

  • I enabled access logging in /etc/sysconfig/jenkins, but it’s always empty.

Environment

CloudBees Jenkins Enterprise

Resolution

Firstly - take a backup of/etc/logrotate.d/jenkins file.

Then, remove the section that says postrotate and replace that whole section with copytruncate

So it should look like this:

/var/log/jenkins/jenkins.log /var/log/jenkins/access_log {
compress
dateext
maxage 365
rotate 99
size=+4096k
notifempty
missingok
create 644
copytruncate
}

The next logrotate run by cron will implement this change.