-
Notifications
You must be signed in to change notification settings - Fork 181
Description
Hi, there is something very weird going on.
Here is my config
services:
Sentry\Monolog\Handler:
arguments:
$hub: '@Sentry\State\HubInterface'
$level: 'error'
monolog:
handlers:
sentry:
type: service
id: Sentry\Monolog\Handler
level: notice
But when i log, etc $this->logger->critical()
, event in sentry does not contain extra informations added by Sentry\SentryBundle\EventListener\RequestListener
.
By debugging i found out there are 2 different instances of HubInterface
. 1 lives in our DI container and second on is in static SentrySdk::$currentHub
property.
What RequestListener
does, is only saving this to the static hub, meanwhile in monolog handler, the instance from DI is wired:
On a screenshot you can see these are 2 different instances of hubs, one contains client (created and autowired by DI) the other does not.
I am thinking, if there is not missing SentrySdk::setCurrentHub()
with the hub created by DI?
Maybe i am just missing something, but this causes many confusions for me.
This might be related to #247