-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Suggest Symfony HttplugClient in symfony guide (#13)
- Loading branch information
Showing
5 changed files
with
54 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Extension points | ||
|
||
It is required to inherit from `SentryHandler` class and override these methods: | ||
|
||
```php | ||
<?php | ||
|
||
use BGalati\MonologSentryHandler\SentryHandler; | ||
use Sentry\State\Scope; | ||
|
||
class CustomSentryHandler extends SentryHandler | ||
{ | ||
/** {@inheritdoc} */ | ||
protected function processScope(Scope $scope, array $record, array $sentryEvent): void | ||
{ | ||
// Your custom logic like this one: | ||
// .... | ||
if (isset($record['context']['extra']) && \is_array($record['context']['extra'])) { | ||
foreach ($record['context']['extra'] as $key => $value) { | ||
$scope->setExtra((string) $key, $value); | ||
} | ||
} | ||
|
||
if (isset($record['context']['tags']) && \is_array($record['context']['tags'])) { | ||
foreach ($record['context']['tags'] as $key => $value) { | ||
$scope->setTag($key, $value); | ||
} | ||
} | ||
} | ||
|
||
/** {@inheritdoc} */ | ||
protected function afterWrite(): void | ||
{ | ||
// Your custom code before events are flushed | ||
// ... | ||
|
||
// Call parent method to keep default behavior or don't call it if you don't need it | ||
parent::afterWrite(); | ||
} | ||
} | ||
``` | ||
|
||
Please look at these methods within [the code](../src/SentryHandler.php) if you want more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters