Skip to content

[MonologBridge] HttpCodeActivationStrategy deprecation warning with default config #39288

@Marv51

Description

@Marv51

Symfony version(s) affected: 5.2

Description
After updating (most likely because of #35740) my project to 5.2 I get this deprecation: "Since symfony/monolog-bridge 5.2: Passing an actionLevel (int|string) as constructor's 3rd argument of "Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy" is deprecated, "Monolog\Handler\FingersCrossed\ActivationStrategyInterface" expected."

How to reproduce
Follow the configuration instructions in the docs:
https://symfony.com/doc/current/logging.html#handlers-that-modify-log-entries

I don't believe that I have any other monolog related code.

My config/packages/test/monolog.yaml file looks like this:

monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            handler: nested
            excluded_http_codes: [404, 405]
            channels: ["!event"]
        nested:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug

(Same as symfony demo)

Additional context
This is mentioned in the upgrade instruction, however it is not clear to me how to change my yaml to fix these deprecations. The docs should be updated to a deprecations-free configuration.

I have applied all the latest recipes and this deprecation seems unrelated to any updated recipes available.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions