4

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.

1 Answers1

6

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

G1.3
  • 1,693
  • 8
  • 24