I’m working up a logrotate configuration file to rotate Symfony2 logs. Do I have to restart anything? For a standard Symfony2 application, I don’t see anything that keeps logfile file descriptors open.
Here’s what I came up with to rotate logs:
/user/app/logs/*.log
{
missingok
notifempty
}
If there were a long-running process (a daemon) which used the Symfony2 framework, I’d imagine that process would have to be restarted during log rotation.
PHP applications use a “shared-nothing” approach – each and every page load starts from scratch, with no open file descriptors or similar. Even when using a FastCGI approach, which keeps the PHP engine from being re-executed for each request, this is still the case.
So no, you shouldn’t need to restart anything – the new requests will output to the new log files with no extra effort needed.
The one situation where this might not be the case is when using worker processes (for instance, servicing queues), but that’s something that you’d already be aware of if you were using it.