G
G
grabbee2020-01-14 16:16:58
symfony
grabbee, 2020-01-14 16:16:58

How to disable deprecation log in Symfony?

With standard settings, deprecation notices in the code are pouring into the log, but sometimes it doesn’t even seem to be in mine. I can see this in development locally, but it shamelessly writes these logs to me in the sale.

monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            handler: nested
            excluded_http_codes: [404, 405]
        nested:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
        console:
            type: console
            process_psr_3_messages: false
            channels: ["!event", "!doctrine"]
        deprecation:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.deprecations.log"
        deprecation_filter:
            type: filter
            handler: deprecation
            max_level: info
            channels: ["php"]

It's like max_level: info for this log, and I just delete these deprecation + deprecation_filter settings. Why do they generally slip them into the prod by default. In the same place, apart from error and critical, there should be nothing. Maximum Warnings.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question