Ability to keep rotate Apache Domlogs for X days in a compressed format
When cPanel is set to delete domlogs after updating stats it moves the log files to a tempory location, runs the stats on it and then deletes the file.
Insead of deleting these files I would like cPanel to gzip the file and keep it in a specified location for a specified number of days.
cPanel does not provide a hook to access the tempory log file before it is deleted otherwise we would just copy this file and use our own log rotation script.
In order to keep a compressed backup of logs we have two options :
1) Disable automatic stats update at all hours and run a home made script that makes a copy of the log file and then run's the stats update for that user
2) Manage log rotation with syslog
With the first option we loose some log entries that are added in between the copy and running the stats update
With the second option the user stats are not complete after the logs are rotated because syslog rotates the whole file and can't for example leave one day's logs in the file.
We would either like to have a hook so we could manage this ourselves without any log or stats data loss or we would like to be able to rotate domlogs to compressed files instead of deleting them.
If cPanel allowed is to specify how many days to keep the rotated archives for this would be the best solution but we could also set up our own system to delete files older than X number of days.