Home
PHP
Tech Tube
MySQL
Linux
CSS&HTML
JavaScript

Logrotate config

Here's a simple example for a logrotate config for laravel logs. Keep in mind that the fact that the logs names contain %Y-%m-%d it doesn't mean that they contain all or only records from the given date.
/var/www/groovesetter/storage/logs/laravel.log {
    daily # Rotate period
    missingok # ignore the file if it is missing
    rotate 30 # keep the logs of the last 30 
    notifempty # does not rotate the log if it is empty
    #compress # will compress the rotated old log files
    su root root # will rotate log files set under this user and group instead of using default user/group (usually root)
    create 777 www-data www-data # will create a new log file with the following permissions
    dateext
    dateformat .%Y-%m-%d
    extension .log
}