Skip to content

Add sentry logger by hooking into monolog setHandlers #184

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

Merged
merged 3 commits into from
Jun 24, 2025

Conversation

indykoning
Copy link
Member

@indykoning indykoning commented Jun 12, 2025

Summary

closes: #134
closes: #159

By plugging into monologs setHandlers method we can ensure sentry is added to ALL instances of monolog, including during crons, queues, and any custom loggers created by other modules.
setHandlers is also executed during the __construct function of monolog.

Result

Even crons and custom extension logs can be sent to Sentry if they match the log level

Checklist

  • I've ran composer run codestyle
  • I've ran composer run analyse

@indykoning indykoning merged commit 24e8d8c into master Jun 24, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Circular dependency after upgrade to 3.9.0 Cron log errors are not sent to Sentry
4 participants