monolog:

    handlers:

        main:
            type: fingers_crossed
            action_level: error
            handler: nested
            excluded_http_codes: [404, 405]

        nested:
            type: rotating_file
            max_files: 15
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug

        console:
            type: console
            process_psr_3_messages: false
            channels: ["!event", "!doctrine"]

        #####################################
        #           Deprecation             #
        #####################################

        deprecation:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"

        deprecation_filter:
            type: filter
            handler: deprecation
            max_level: info
            channels: ["php"]

        #####################################
        #           Security                #
        #####################################

        security:
            type: rotating_file
            max_files: 15
            path: '%kernel.logs_dir%/%kernel.environment%.security.log'
            level: info
            channels: security

        #####################################
        #           Critical                #
        #####################################

        main_critical:
            type: fingers_crossed
            action_level: critical
            handler: grouped_critical

        grouped_critical:
            type: group
            members: [streamed_critical, buffered_critical]

        streamed_critical:
            type: rotating_file
            max_files: 15
            path: '%kernel.logs_dir%/%kernel.environment%.critical.log'
            level: info

        #####################################
        #           Swift                   #
        #####################################

        buffered_critical:
            type: deduplication
            handler: swift_critical

        swift_critical:
            type: swift_mailer
            from_email: 'sebastien@felix-creation.fr'
            to_email: ['sebastien@felix-creation.fr', 'fournier.sebastien@outlook.com']
            subject: 'An Error Occurred! %%message%%'
            level: debug
            formatter:  monolog.formatter.html
            content_type: text/html