Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony monolog fingers crossed handler not excluding specified http codes

I am using the fingers crossed handler to buffer log messages until an error occurs. Below is my config:

monolog:
  handlers:
    buffer:
      action_level: error
      excluded_http_codes: [401, 403, 404]
      handler: logger
      type: fingers_crossed
    logger:
      formatter: monolog.formatter.json
      include_stacktraces: true
      level: info
      path: php://stderr
      type: stream

I am finding that exceptions that should match the excluded_http_codes are still being output into my log.

I have dug into the Symfony\Bridge\Monolog\Handler\FingersCrossed\HttpCodeActivationStrategy class and am finding that $this->requestStack->getMasterRequest() is returning null by the time the exception reaches the isHandlerActivated method.

Is there something I am clearly doing wrong?

like image 415
Ben Guest Avatar asked Sep 18 '25 06:09

Ben Guest


1 Answers

This issue is resolved since updating my composer packages. I'm not sure which package was specifically responsible

like image 137
Ben Guest Avatar answered Sep 21 '25 10:09

Ben Guest