Create a new config file
vim /etc/logrotate.d/mylogrotate
Here are some logrotate options
/var/log/mylogrotate/* {
{daily | weekly | monthly} <-- How often to rotate
rotate 3 <-- Only 3 rotate logs should be kept. Oldest file will be removed on fourth run
size 10M <-- The minimum size before a rotation can occur. (The log file won't be rotated unless it's at least 10M in size)
compress <-- Compress and Delaycompress is to compress all rotated logs, with the exception of the most recent one
delaycompress <-- ^
}
Config example