Skip to content

Instantly share code, notes, and snippets.

@molotovbliss
Last active April 26, 2021 17:33
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save molotovbliss/60830cf505b6231852fe to your computer and use it in GitHub Desktop.
Save molotovbliss/60830cf505b6231852fe to your computer and use it in GitHub Desktop.
Magento Log Rotate with logrotate
The magento-logrotate.conf file contents:
/path/to/magento/var/log/*log {
rotate 7
daily
compress
missingok
notifempty
copytruncate
create 660 www-data www-data
}
Adjust `create 660 www-data www-data` as needed per environment.
Add a Daily cron to rotate your logs:
0 0 * * * /usr/sbin/logrotate -f /path/to/magento-logrotate.conf
@lrkwz
Copy link

lrkwz commented Aug 30, 2017

I think you are missing something

copytruncate
create 660 www-data www-data

change user and group according with your setup.

@molotovbliss
Copy link
Author

I think you are missing something

copytruncate
create 660 www-data www-data

change user and group according with your setup.

Thanks, added!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment