Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **** create file: sudo vi /etc/logrotate.d/descriptive_name_here
- **** code example, e.g., this one is symfony:
- /var/www/current/var/logs/prod.log {
- su ubuntu www-data
- daily
- missingok
- rotate 14
- compress
- }
- **** IMPORTANT: first line is path to application's log, so change to match
- **** change "su ubuntu www-data" to user/group application runs under, i.e., www-data www-data for nginx
- **** test config with sudo logrotate --d /etc/logrotate.d/file_name_from_above
- **** option force rotation: sudo logrotate --force /etc/logrotate.d/file_name
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement