-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
PHP Monolog logs #14781
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
PHP Monolog logs #14781
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Bundle ReportChanges will increase total bundle size by 375.28kB (1.62%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: sentry-docs-server-cjsAssets Changed:
view changes for bundle: sentry-docs-client-array-pushAssets Changed:
|
16c4d50 to
d65ed14
Compare
| $logger = new Logger('sentry_logs'); | ||
| $logger->pushHandler(new \Sentry\Monolog\LogsHandler( | ||
| LogLevel::info(), // Minimum level to send logs | ||
| )); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Sentry Monolog LogsHandler: Parameter Mismatch
The LogsHandler is instantiated with incorrect parameters. It uses LogLevel::info() from Sentry\Logs\LogLevel (called as a method with parentheses) instead of Monolog\Level::Info, and it's missing the hub parameter with named arguments. Other Sentry Monolog handlers in the same file (BreadcrumbHandler and Handler) consistently use named parameters with hub: \Sentry\SentrySdk::getCurrentHub() and level: Level::Info, which is the correct pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LogsHandler uses (LogLevel, bool) in the constructor. This comment would be correct for BreadcrumbHandler which uses a different signature
dingsdax
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice one
closes #1893
closes PHP-22