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 breadcrumb monolog handler #1199

Merged
merged 12 commits into from
Sep 1, 2022
Merged

Conversation

Jean85
Copy link
Collaborator

@Jean85 Jean85 commented Mar 17, 2021

This is an interesting additional feature, that would be a required stepping stone for me to proceed with the strategy outlined in getsentry/sentry-symfony#337 (comment).

@Jean85 Jean85 added this to the 3.3 milestone Mar 17, 2021
@Jean85 Jean85 self-assigned this Mar 17, 2021
@github-actions

This comment was marked as outdated.

@Jean85
Copy link
Collaborator Author

Jean85 commented Jan 12, 2022

This should wait for #1275

@Jean85 Jean85 force-pushed the add-breadcrumb-monolog-handler branch from 2deb9ea to 2d23abe Compare January 13, 2022 22:30
Copy link
Collaborator

@stayallive stayallive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me! 👍

@github-actions
Copy link

github-actions bot commented Feb 4, 2022

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 🥀

@miedzikd
Copy link

Do you have plan to release this change?

@Jean85
Copy link
Collaborator Author

Jean85 commented May 30, 2022

It needs more work after #1321, I'll try to look at it now.

@allan-simon
Copy link

@Jean85 is there any way we can help on this PR , as this would remove for us the need of https://github.com/B-Galati/monolog-sentry-handler (as we use it to get log as breadcrumb )

@Jean85
Copy link
Collaborator Author

Jean85 commented Aug 24, 2022

This needs a rebase/remerge badly. I'll try it now.

@cleptric
Copy link
Member

@Jean85 Just some general thoughts/questions

  • From what I gathered from the linked issue, this will primarily be used in the Symfony SDK. Would it suffice to add it only there?
  • Do we need to add some docs to tell people how to wire it up on their application if they use monolog?

@Jean85
Copy link
Collaborator Author

Jean85 commented Aug 29, 2022

  • the Symfony official integration would be the main immediate beneficiary of this feature, but since it's based on Monolog, it can be used/leveraged everywhere
  • this may depend a lot on the application, since Monolog could be wired manually or baked into the app config (see Symfony, maybe Laravel too?)

I would ask @stayallive if the Laravel integration could benefit from this too, and/or if it could require dedicated documentation.

@stayallive
Copy link
Collaborator

This could possibly also be used by Laravel, since Laravel also uses Monolog under the hood, so it would probably need some added info to the documentation on how to leverage this in a Laravel context.

@cleptric cleptric modified the milestones: 3.3, 3.8 Sep 1, 2022
@cleptric cleptric merged commit 6695102 into develop Sep 1, 2022
@cleptric cleptric deleted the add-breadcrumb-monolog-handler branch September 1, 2022 11:05
@B-Galati
Copy link
Contributor

B-Galati commented Sep 6, 2022

Any updates about the doc to know how to set it up?

@cleptric
Copy link
Member

cleptric commented Sep 6, 2022

I'll write something up in the coming days 🙂
getsentry/sentry-docs#5487

@michaelgracious
Copy link

I'll write something up in the coming days slightly_smiling_face getsentry/sentry-docs#5487

Any update on this?

@dkarlovi
Copy link

dkarlovi commented Nov 9, 2022

In short, do this:

services:
    Sentry\Monolog\BreadcrumbHandler:
        arguments:
            - '@Sentry\State\HubInterface'
            - !php/const Monolog\Logger::INFO

monolog:
    handlers:
        # this one acts like fingers_crossed
        sentry_breadcrumbs:
            type: service
            name: sentry_breadcrumbs
            id: Sentry\Monolog\BreadcrumbHandler
        # this one is the main one, once it captures, the breadcrumbs collected by the first one are submitted too
        sentry:
            type: sentry
            level: !php/const Monolog\Logger::ERROR
            hub_id: Sentry\State\HubInterface

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

9 participants