Search code examples
symfonysymfony-2.8monolog

Symfony 2.8 Monolog rotating_file - prevent generation of prod.log file


My prod.log file is getting very large, so I want to use the rotating_file option to create one file per day (max 14). It works, everyday a new file is generated but the file prod.log still exists and logs all new messages. Is it possible to prevent the generation of prod.log file? I use Symfony 2.8, monolog 1.23.0 and the default configuration in config.yml:

monolog:
    use_microseconds: false
    handlers:
        main:
            type:  rotating_file
            path:  '%kernel.logs_dir%/%kernel.environment%.log'
            level: error
            max_files: 14

Solution

  • Problem solved. I disabled full monolog configuration, cleared both caches, reenabled the configuration, cleared cache again, now it works. Strange cache problem, seems both configurations were used.