timrutte / laminas-log-writer-sentry
Log writer to send all logs to Sentry
v1.0
2023-02-24 20:55 UTC
Requires
- laminas/laminas-log: ^2.16
- sentry/sdk: ^3.3
README
Installation
Run the following to install this library:
$ composer require timrutte/laminas-log-writer-sentry
Usage
$writer = new \TimRutte\Laminas\Log\Writer\Sentry(); $writer->configureSentry( '<SENTRY_DSN>', '<ENVIRONMENT>', '<MIN_LOG_LEVEL>' ); $formatter = new \Laminas\Log\Formatter\Json(); $writer->setFormatter($formatter); $logger = new \Laminas\Log\Logger(); $logger->addWriter($writer);