Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the Monolog hook functionality #573

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Add the Monolog hook functionality #573

wants to merge 6 commits into from

Conversation

Jean85
Copy link
Collaborator

@Jean85 Jean85 commented Nov 19, 2021

This is another attempt at #337

I'm currently following the strategy outlined in #337 (comment)

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.

@Jean85 Jean85 added this to the 5.0 milestone Nov 19, 2021
@Jean85 Jean85 self-assigned this Nov 19, 2021
@Jean85
Copy link
Collaborator Author

Jean85 commented Nov 19, 2021

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}.

@github-actions

This comment was marked as outdated.

Base automatically changed from develop to master May 30, 2022 12:09
@Jean85 Jean85 changed the base branch from master to develop June 1, 2022 15:51
@Jean85
Copy link
Collaborator Author

Jean85 commented Jun 1, 2022

@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? 👇 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 (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}.

@cleptric cleptric changed the base branch from develop to 5.x October 13, 2022 09:14
@cleptric cleptric changed the base branch from 5.x to develop November 22, 2022 15:09
Base automatically changed from develop to master February 14, 2023 15:52
@getsantry getsantry bot added the Stale label Oct 18, 2023
@cleptric cleptric removed the Stale label Oct 18, 2023
@getsentry getsentry deleted a comment from getsantry bot Oct 18, 2023
@cbastienbaron
Copy link

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 🤞 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants