brainbits / monolog-sentry
brainbits sentry
Installs: 20 562
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 2
Open Issues: 3
Requires
- php: ^8.2
- ext-iconv: *
- bgalati/monolog-sentry-handler: ^2.1
- jean85/pretty-package-versions: ^2.0
- monolog/monolog: ^3.0
- nyholm/psr7: ^1.2.1
- psr/log: ^1.1|^2.0|^3.0
- sentry/sentry: ^4.6.1
- symfony/config: ^6.4|^7.0
- symfony/dependency-injection: ^6.4|^7.0
- symfony/http-client: ^6.4|^7.0
- symfony/http-kernel: ^6.4|^7.0
- symfony/yaml: ^6.4|^7.0
Requires (Dev)
- brainbits/phpcs-standard: ^7.0.1
- ergebnis/phpstan-rules: ^2.2
- nyholm/nsa: ^1.3
- phpstan/phpstan: ^1.10.59
- phpstan/phpstan-phpunit: ^1.3.16
- phpunit/phpunit: ^11.0.4
- symfony/console: ^6.4|^7.0.4
- symfony/messenger: ^6.4|^7.0.4
- symfony/security-bundle: ^6.4|^7.0.4
- thecodingmachine/phpstan-strict-rules: ^1.0
Suggests
- symfony/console: For the console listener
- symfony/messenger: For the messenger resetter
- symfony/security-bundle: For the user listener
This package is auto-updated.
Last update: 2024-11-14 18:31:31 UTC
README
This package provides a opiniated factory for bgalati/monolog-sentry-handler, based on the provided symfony guide.
Required configuration:
# brainbits_monolog_sentry.yaml parameters: env(SENTRY_DSN): '' env(SENTRY_ENVIRONMENT): '' services: _defaults: autowire: true autoconfigure: true Brainbits\MonologSentry\SentryFactory: ~ Sentry\State\HubInterface: factory: ['@Brainbits\MonologSentry\SentryFactory', 'create'] arguments: $dsn: '%env(SENTRY_DSN)%' $environment: '%env(SENTRY_ENVIRONMENT)%' $inAppInclude: ['%kernel.project_dir%/src'] $inAppExclude: ['%kernel.cache_dir%', '%kernel.project_dir%/vendor'] $prefixes: ['%kernel.project_dir%'] $release: 'web-%app_version%' $tags: foo: bar $logger: '@logger' Controlling\Sentry\Sentry\SentryHandler: ~ Controlling\Sentry\EventListener\SentryConsoleListener: ~ Controlling\Sentry\EventListener\SentryRequestListener: Controlling\Sentry\EventListener\SentryUserListener: Controlling\Sentry\EventListener\MonologResetterEventListener: ~
Example monolog configuration:
# monolog.yaml when@prod: monolog: handlers: sentry: type: fingers_crossed process_psr_3_messages: true action_level: warning handler: sentry_buffer excluded_http_codes: [400, 401, 403, 404, 405] buffer_size: 100 # Prevents memory leaks for workers channels: ["!event", "!security"] sentry_buffer: type: buffer handler: sentry_handler sentry_handler: type: service id: 'Brainbits\MonologSentry\SentryHandler'