Skip to content

Instantly share code, notes, and snippets.

@xtrasmal
Created June 11, 2015 13:14
Show Gist options
  • Save xtrasmal/664a35d0b2b10b1c6290 to your computer and use it in GitHub Desktop.
Save xtrasmal/664a35d0b2b10b1c6290 to your computer and use it in GitHub Desktop.
logrotate symfony
# cd /etc/logrotate.d && touch symfony && nano symfony
/var/www/sitename/app/logs/dev.log {
monthly
missingok
rotate 4
compress
sharedscripts
copytruncate
size 100M
}
/var/www/sitename/app/logs/prod.log {
monthly
missingok
rotate 4
compress
sharedscripts
copytruncate
size 100M
}
@aureliengiry
Copy link

aureliengiry commented Jun 23, 2017

Thanks for this settings.
If you want you can use wildcard like this /var/www/sitename/app/logs/*.log.
Like this, if you use different channels on monolog you can apply logrotate on all log files

@sacams
Copy link

sacams commented Jul 30, 2018

Hello I would like to create the log files whose name would include the date of the day in symfony4 but I dry the top is there a possibility to do it?

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