SentryHandler
class SentryHandler extends AbstractProcessingHandler
Traits
Properties
| protected string|null | $environment | The current application environment. |
|
| protected string|null | $release | The current version of the calling software. |
|
| protected FormatterInterface|null | $batchFormatter | The formatter to use for the logs generated via handleBatch(). |
Methods
Create a new Sentry handler instance.
No description
Set the formatter for the logs generated by handleBatch().
Get the formatter for the logs generated by handleBatch().
Translate Monolog log levels to Sentry Severity.
Write a record to the handler.
Get the default formatter.
Get the default formatter for the logs generated by handleBatch().
Set the release.
Set the current application environment.
Add a breadcrumb.
Details
at line 48
__construct(HubInterface $hub, int|string $level = Logger::DEBUG, bool $bubble = true, bool $reportExceptions = true, bool $useFormattedMessage = false)
Create a new Sentry handler instance.
at line 58
void
handleBatch(array $records)
No description
at line 102
SentryHandler
setBatchFormatter(FormatterInterface $formatter)
Set the formatter for the logs generated by handleBatch().
at line 112
FormatterInterface
getBatchFormatter()
Get the formatter for the logs generated by handleBatch().
at line 124
protected Severity
getLogLevel(int $logLevel)
Translate Monolog log levels to Sentry Severity.
at line 135
protected void
doWrite(mixed $record)
Write a record to the handler.
at line 209
protected FormatterInterface
getDefaultFormatter()
Get the default formatter.
at line 217
protected FormatterInterface
getDefaultBatchFormatter()
Get the default formatter for the logs generated by handleBatch().
at line 228
SentryHandler
setRelease(string $value)
Set the release.
Boot-only. Mutates the release on the worker-lifetime log handler; per-request use races across coroutines and affects every subsequent log event.
at line 241
SentryHandler
setEnvironment(string $value)
Set the current application environment.
Boot-only. Mutates the environment on the worker-lifetime log handler; per-request use races across coroutines and affects every subsequent log event.
at line 253
SentryHandler
addBreadcrumb(Breadcrumb $crumb)
Add a breadcrumb.