webowi / symfony-monitoring-bundle
Symfony bundle that ships error logs to Monitoring Webowi with near-zero configuration.
Package info
github.com/webowi/symfony-monitoring-bundle
Type:symfony-bundle
pkg:composer/webowi/symfony-monitoring-bundle
Requires
- php: >=8.1
- ext-curl: *
- ext-json: *
- monolog/monolog: ^3.0
- psr/log: ^3.0
- symfony/config: ^6.4 || ^7.0 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.0 || ^8.0
- symfony/http-kernel: ^6.4 || ^7.0 || ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.57
- infection/infection: ^0.32
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^10
README
Ships error-level Symfony logs (with full surrounding context) to Monitoring Webowi with near-zero configuration.
Install
composer require webowi/symfony-monitoring-bundle
Add to config/packages/symfony_monitoring.yaml:
symfony_monitoring: url: '%env(MONITORING_WEBOWI_URL)%' api_key: '%env(MONITORING_WEBOWI_API_KEY)%' level: error
Get your project's url and api_key from your Monitoring Webowi project's ingestion-key page.
Running in Docker?
localhostinside your app's container does not reach a Monitoring Webowi instance running in a sibling container/stack. Usehttp://host.docker.internal:<port>/...(Docker Desktop on Mac/Windows) instead, or the instance's container/service name if both stacks share a Docker network.
That's it — no monolog.yaml wiring needed. The bundle registers the full handler chain (including a fingers_crossed buffer so the full DEBUG-and-up context leading up to an error is sent, not just the error line itself) automatically. For any log record carrying an exception in its context, the bundle also resolves an HTTP status code — the exception's own status if it implements HttpExceptionInterface, otherwise 500 — and sends it as http_status_code.
Configuration reference
| Key | Required | Default | Description |
|---|---|---|---|
url |
yes | — | Base URL of your Monitoring Webowi instance |
api_key |
yes | — | Your project's ingestion API key |
level |
no | error |
PSR-3 level at which a buffered request's context is flushed and sent |
License
MIT