pmoubed
pmoubed

Reputation: 3922

Symfony2, Is there any way to use Monolog to split the log files every day?

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.

Upvotes: 1

Views: 1406

Answers (1)

Nicolai Fröhlich
Nicolai Fröhlich

Reputation: 52513

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

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

Upvotes: 2

Related Questions