Azure: Linux: Error: waagent-extn.logrotate:1 duplicate log entry
Suddenly, received email notices about the error in file waagent-extn.logrotate .
Removed the /etc/logrotate.d/azure-lad .
Back to normal.
Update
$ sudo /usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf
error: waagent-extn.logrotate:1 duplicate log entry for /var/log/azure/Microsoft.Azure.Diagnostics.LinuxDiagnostic/extension.log
error: found error in file waagent-extn.logrotate, skipping
Checked the WALinuxAgent. It was the latest version.
$ sudo yum list WALinuxAgent
Run:
$ grep -rnw /etc/logrotate.d/ -e extension.log
/etc/logrotate.d/azure-lad:45:/var/log/azure/Microsoft.Azure.Diagnostics.LinuxDiagnostic/extension.log
Then, identified another config doing the same:
/etc/logrotate.d/waagent-extn.logrotate
/var/log/azure/*/*.log {
# Old versions of log files are compressed with gzip by default.
compress
# Rotate log files > 10 MB, and keep last 10 archived files. With an compression ratio ranging from 5-10%, The
# archived files would take an average of around 5-10 MB.
size 10M
rotate 10
# Add date as extension when rotating logs
dateext
# Formatting the date extension to YYYY-MM-DD-SSSSSSS format. logrotate does not provide hours, mins and seconds
# option. Adding the %s (system clock epoch time) to differentiate rotated log files within the same day.
dateformat -%Y-%m-%d-%s
# Do not rotate the log if it is empty
notifempty
# If the log file is missing, go on to the next one without issuing an error message.
missingok
}
So, why to notice log entry duplicating.
Back to normal.
References
Update