Logrotate for log files without `.log` extension

672 views Asked by At

I need to have logrotate rotate all the logs in a direcory, but those log files have NO extension. I'd like to know if the Linux logrotate command also works for files not having .log extension.

1

There are 1 answers

0
hek2mgl On

Yes of course this will work. Use a config like this:

/path/to/YOURLOGFILE {
    monthly
    rotate 12
    compress
    ... more settings
}

into /etc/logrotate.d/your-service. Even the man page provides an example, it shows how to rotate /var/log/messages