phpro / api-problem-bundle

RFC7807 Problem details integration for Symfony
MIT License
22 stars 10 forks source link

Listener prevents Symfony from logging incidents (http >= 500) to monolog #3

Closed pscheit closed 5 years ago

pscheit commented 5 years ago

a priority from -5 should be better, because then, the "logKernelException()" call from symfony would not be intercepted.

 ------- ------------------------------------------------------------------------------------------- ----------
  Order   Callable                                                                                    Priority
 ------- ------------------------------------------------------------------------------------------- ----------
  #2      Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelException()            0
  #3      Symfony\Component\HttpKernel\EventListener\ExceptionListener::logKernelException()          0
  #4      Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener::onException()           0
  #5      Phpro\ApiProblemBundle\EventListener\JsonApiProblemExceptionListener::onKernelException()   -5
  #6      Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelException()              -64
  #7      Symfony\Component\HttpKernel\EventListener\ExceptionListener::onKernelException()           -128
  #8      Symfony\Component\HttpKernel\EventListener\ExceptionListener::onKernelException()           -2048
 ------- ------------------------------------------------------------------------------------------- ----------

console debug:event-dispatcher kernel.exception

veewee commented 5 years ago

Hi @pscheit

Thanks for logging this issue. It is indeed suboptimal not to log exceptions. Didn't notice it myself untill now :)

pscheit commented 5 years ago

indeed. This was a big wtf moment in production :D