Is the log for your custom app getting a little long? Have a need to keep your logs around but would like to keep their size down to a more managable size? Logrotate is the easy and powerful answer. You can tell logrotate to rotate your logs on various different triggers (daily, weekly, some other time, on a specific file size, on a specific number of lines, etc). You can tell it what to do before and after rotating (to put mysql into a safe state, or to restart apache to rebuild deleted log files, for example).
Just create a script in /etc/logrotate.d/ with your logrotate rules, and logrotate will execute them next time cron runs it. Check out man logrotate for more config options, and take a look at the other scripts in logrotate.d for examples.
Tip: it’s been my experience that apache’s logrotate handler is almost never configured for the right path out of the box! So you might think logrotate’s been working, when it’s not. Check out your log paths in /etc/logrotate.d/httpd or /etc/logrotate.d/apache2





