shippeo / monolog-extra
An extension to Monolog that adds handlers, formatters and processors. Includes integrations for Symfony.
Installs: 78 035
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 14
Forks: 1
Open Issues: 1
Requires
- php: ^7.2||^8.1
- graylog2/gelf-php: ^1.6
- monolog/monolog: ^2.9.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.13
- pedrotroller/php-cs-custom-fixer: ^2.15
- phpstan/phpstan: ^1.10
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^10.3
This package is auto-updated.
Last update: 2025-03-10 18:58:56 UTC
README
An extension to Monolog that adds handlers, formatters and processors. Includes integrations for Symfony.
Cookbook symfony
Processor
ApplicationName
Declaration of service config/services.yaml
with tag monolog.processor
Shippeo\Monolog\Processor\ApplicationNameProcessor:
arguments:
- '%env(APP_NAME)%'
tags:
- { name: 'monolog.processor' }
Formatter
Gelf
Declaration of handler in config/monolog.yaml
monolog:
handlers:
graylog:
type: gelf
level: info
publisher: {hostname: '%env(GRAYLOG_HOST)%', port: '%env(GRAYLOG_PORT)%', chunk_size: 0}
formatter: App\Log\GelfMessageFormatter
Declaration of service in config/services.yaml
Shippeo\Monolog\Formatter:
- '%env(GRAYLOG_TOKEN)%'