monolog:
    channels:
        - deprecation # Deprecations are logged in the dedicated "deprecation" channel when it exists

when@dev:
    monolog:
        handlers:
            main:
                type: stream
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug
                channels: ["!event"]
            # uncomment to get logging in your browser
            # you may have to allow bigger header sizes in your Web server configuration
            #firephp:
            #    type: firephp
            #    level: info
            #chromephp:
            #    type: chromephp
            #    level: info
            console:
                type: console
                process_psr_3_messages: false
                channels: ["!event", "!doctrine", "!console"]

when@qual:
    monolog:
        handlers:
            # main:
            #     type: fingers_crossed
            #     action_level: error
            #     handler: nested
            #     excluded_http_codes: [404, 405]
            #     channels: ["!event"]
            main:
                # type: stream
                type:  rotating_file
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug 
                # info
                max_files: 15

# when@prod:
#     monolog:
#         handlers:
#             main:
#                 # type: stream
#                 type:  rotating_file
#                 path: "%kernel.logs_dir%/%kernel.environment%.log"
#                 level: debug 
#                 # info
#                 max_files: 15

# merci : https://www.kitpages.fr/fr/cms/175/monolog-en-production

when@prod:
    monolog:
        handlers:
            main:
                type: fingers_crossed
                action_level: error
                handler: nested
                excluded_http_codes: [404, 405]
                buffer_size: 50 # How many messages should be saved? Prevent memory leaks
            nested:
                type: rotating_file
                path: "%kernel.logs_dir%/%kernel.environment%.log"
                level: debug
                max_files: 15
                # formatter: monolog.formatter.json
            console:
                type: console
                process_psr_3_messages: false
                channels: ["!event", "!doctrine"]
            deprecation:
                type: stream
                channels: [deprecation]
                path: php://stderr
