Monolog Log Handler is using old constructor parameters
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 90/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- php
- Domain
- documentation
Research direction
Open the PHP Logs page linked in the issue and review the LogsHandler example against the sentry/sentry 4.30 signature. Update the example to use the working constructor form, or clearly identify the SDK version it targets. Done means the documented example matches the supported API and no longer passes a Hub to LogsHandler.
Written by the indexing model from the issue text.
Description
SDK
PHP SDK
Description
Page: https://docs.sentry.io/platforms/php/logs/
SDK version: sentry/sentry 4.30
Problem
The PHP Logs docs show constructing the Monolog logs handler with a Hub (and level) argument
$handler = new \Sentry\Monolog\LogsHandler($hub, Level::Info);
This signature does not exist in sentry/sentry 4.30. LogsHandler does not accept a Hub in its constructor, so following the docs as written fails.
What works instead (4.30)
$log->pushHandler(new \Sentry\Monolog\LogsHandler(Level::Info));
The handler uses the current hub from the initialized SDK; no Hub argument is needed.
Request
Please update the Logs page to match the 4.x LogsHandler signature, or clarify which SDK version the current example targets.
Suggested Solution
$log->pushHandler(new \Sentry\Monolog\LogsHandler(Level::Info));
- Dominant language
- MDX
- Stars
- 446
- Forks
- 1.7k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 312
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-docs
-
Docs Platform: Android SDKs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
getsentry/sentry-docs#19438 · 1 comment ·
-
Docs Platform: Python SDKs
Difficulty 1/5 Under an hour Newbie friendliness 92/100
getsentry/sentry-docs#19432 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsentry/sentry-docs#19347 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
getsentry/sentry-docs#19182 · 1 comment ·
-
Docs Product
Difficulty 2/5 Half a day Newbie friendliness 68/100
getsentry/sentry-docs#19028 · 1 comment ·
All issues in getsentry/sentry-docs
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
fullcalendar/fullcalendar#8106 ·