Question

How do I limit the log size when using CakeLog? I am using Ubuntu, if that makes a difference.

Was it helpful?

Solution

Use logrotate, which is included in Ubuntu. Create a file in /etc/logrotate.d named something like cakelogs. An example which would rotate and compress all *.log files in all Cake tmp/logs directories would look like this:

/var/www/*/public/tmp/logs/*.log {
    weekly
    missingok
    rotate 52
    compress
    dateext
    delaycompress
    notifempty
    create 640 www-data www-data
    sharedscripts
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top