We are using logrotate tool for our AWS ec2 instances. Following is the script I am using in rsyslog file:
/opt/solr-6.5.0/server/logs/solr.log
{
daily
rotate 1
missingok
notifempty
sharedscripts
maxsize 500M
copytruncate
dateformat -%d %b %Y %H:%M:%S
compress
prerotate
/usr/bin/find /opt/solr-6.5.0/server/logs/solr.log -mtime +0 -not -name '*.gz' 2>/dev/null -exec gzip {} \; || true
/usr/bin/find /opt/solr-6.5.0/server/logs/solr.log -mtime +15 -delete 2>/dev/null || true
endscript
postrotate
reload rsyslog >/dev/null 2>&1 || true
endscript
}
Note: The above script is being used for rotating solr logs.
The issue is that logs from 12AM(00:00:00)UTC to 6:25:00UTC are not present in the log file.
This is how the starting of the log file looks like:
I want the logs should to be starting from 12AM UTC instead of 6:25AM UTC.
Please help me. I am stuck on this issue for last 3 months. Thanks in advance.
I have tried adding the sharedscripts and increased the maxsize from 50M to 500M, also tried adding the dateformat. But these changes did not fix the issue.