Enable a log rotation


How can I enable a log rotation with Slim3?
I didn’t find documentation about the log configuration. Is there any resources available?

Thank you

If you’re using monolog, then look at the RotatingFileHandler.

1 Like

Ok, I can make it work now.

I was wondering how the “config.php” is used to instanciate the correct logger. I didn’t realize that I had to take a look inside “dependencies.php” file to understand the process.

Now I have this line in the dependencies: $logger->pushHandler(new Monolog\Handler\RotatingFileHandler($settings['path'], $settings['maxFiles'], $settings['level'])); and it works perfectly.

Thank you!