Symfony: monolog formatter not being applied to all log messages

Viewed 61

I want to have all my logs stored as json so I'm using the monolog.formatter.json like this

monolog:
    handlers:
        main:
            type: stream
            path: "php://stderr"
            level: info
            channels: ["!event"]
            formatter: 'monolog.formatter.json

However i'm still seeing in the logs lines like this

[2021-04-16T09:29:17.946886+00:00] security.DEBUG: Checking for authenticator support. {
    "firewall_name": "endusers",
    "authenticators": 2
} {
    "request_id": "21b36d09-8cc0-466c-b835-1bc8fb05bf47"
}

(but i correctly have other logs formatted like this

{
    "message": "......",
    "context": [
        1401
    ],
    "level": 100,
    "level_name": "DEBUG",
    "channel": "doctrine",
    "datetime": "2021-04-16T09:29:18.047739+00:00",
    "extra": {
        "request_id": "21b36d09-8cc0-466c-b835-1bc8fb05bf47"
    }
}

which makes me think that my configuration is correct but somehow some logs are not going through my handler

Is there something I'm missing ?

(I'm using symfony 5.2 and monologbundle 3.7.0 )

0 Answers
Related