sentry-symfony
sentry-symfony copied to clipboard
Add the Monolog hook functionality
This is another attempt at #337
I'm currently following the strategy outlined in https://github.com/getsentry/sentry-symfony/issues/337#issuecomment-800920045
It seems to work with this config:
sentry:
register_error_listener: false
monolog:
error_handler:
enabled: true
options:
# TODO: add a simple option to switch off the error/fatal integrations
default_integrations: false
integrations: []
But E2E tests are failing and I'm having a hard time to run them with the debugger.
Reason found: attacching the handler to monolog.logger
is not enough, that's just the logger for the default channel (normally app
).
We would need to add the handler to all the existing channels, but I can't find an easy way to do it, the services are not tagged, they are just called monolog.logger.{channel_name}
.
This pull request has gone three weeks without activity. In another week, I will close it.
But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog
or Status: In Progress
, I will leave it alone ... forever!
"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀
@nicolas-grekas, since you were the first in suggesting this approach of attaching Sentry to Monolog in #337, do you have any suggestion to solve this issue? :point_down: Or can you point me to someone else that could help?
Reason found: attacching the handler to
monolog.logger
is not enough, that's just the logger for the default channel (normallyapp
).We would need to add the handler to all the existing channels, but I can't find an easy way to do it, the services are not tagged, they are just called
monolog.logger.{channel_name}
.
hey @Jean85 ,
thanks for this pr / explanation :) from what i understand, at this time if we want to work with monolog and sentry (as simple handler of monolog) , the best solution (for prod env) is to use alt https://github.com/B-Galati/monolog-sentry-handler/ ? (the time to this pr to be finished :crossed_fingers: )