Skip to content

Commit d68bb11

Browse files
Hashim1999164Litarnusgiortzisg
authored
Fix PHP Monolog LogsHandler constructor in logs docs (#19640)
## DESCRIBE YOUR PR Fixes #19177 The PHP logs setup snippet still constructed LogsHandler with a Hub argument. In sentry/sentry 4.x that constructor only takes a log level (and bubble), so the sample failed as written. Updated it to match the working 4.x call. ## IS YOUR CHANGE URGENT? - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## PRE-MERGE CHECKLIST - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## Test plan - [x] Compared against sentry-php 4.30 LogsHandler::__construct - [ ] Spot check https://docs.sentry.io/platforms/php/logs/ after merge --------- Co-authored-by: Martin Linzmayer <martin.linzmayer@sentry.io> Co-authored-by: Giannis Gkiortzis <58184179+giortzisg@users.noreply.github.com>
1 parent 853817c commit d68bb11

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

  • platform-includes/logs/setup

‎platform-includes/logs/setup/php.mdx‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ use Monolog\Logger;
2222
]);
2323

2424
$log = new Logger('app');
25-
$log->pushHandler(new \Sentry\Monolog\LogsHandler(
26-
hub: \Sentry\SentrySdk::getCurrentHub(),
27-
level: Level::Info,
28-
));
25+
$log->pushHandler(new \Sentry\Monolog\LogsHandler(Level::Info, true, false));
2926

3027
// Your existing Monolog usage will now send logs to Sentry
3128
$log->info('Application started');

0 commit comments

Comments
 (0)