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.

This article is part of our Knowledge Base and is provided for guidance-based purposes only. The solutions or workarounds described here are not officially supported by CloudBees and may not be applicable in all environments. Use at your own discretion, and test changes in a safe environment before applying them to production systems.