1

I would like to use Monolog in symfony2 application for logging, but my question is how can I split the file every day instead of appending to the same file?

I would like my log file to be somthing like below:

"%kernel.logs_dir%/%kernel.environment%.%date%.log"

Which %date% should be replaced with real date.

pmoubed
  • 3,842
  • 10
  • 37
  • 60
  • 2
    See [log-rotating-with-monolog-in-symfony2](http://stackoverflow.com/questions/20126530/log-rotating-with-monolog-in-symfony2) – GabLeRoux Mar 19 '15 at 13:38

1 Answers1

2

That's what you would normally use logrotate for ...

... but you can adjust the builtin RotatingFileHandler to achieve your aim.

Nicolai Fröhlich
  • 51,330
  • 11
  • 126
  • 130