How to add custom log files in logrotate

Create a custom log file within /etc/logrotate.d directory.

touch /etc/logrotate.d/customlog

Add the following to your /etc/logrotate.d/customlog file.

/var/log/customlog
{
 daily
 missingok
 compresscmd=/bin/gzip
 compressext=.gz
 compress
 sharedscripts
# postrotate
# endscript
}


Restart logrotate

sudo /usr/sbin/logrotate /etc/logrotate.conf

Done