Reputation: 53
community. I need make logs files daily with Symfony4; or push a current date in a yml file. Specifically in monologo.yml.
handlers:
app:
type: stream
path: "%kernel.logs_dir%/system_compact_%kernel.environment%-***date***.log"
channels: ["app"]
Thank a lot.
Upvotes: 5
Views: 3240
Reputation: 1879
Use can use "rotating_file" log type:
monolog:
handlers:
main:
type: rotating_file
path: "%kernel.logs_dir%/system_compact_%kernel.environment%.log"
Look at this documentation page: https://symfony.com/doc/current/logging.html#how-to-rotate-your-log-files
Upvotes: 6