mpluskassa / laravel-datadog
A Laravel logging driver for Datadog HTTP log intake.
v1.0.0
2026-06-29 14:35 UTC
Requires
- php: ^8.2
- illuminate/http: ^11.0|^12.0|^13.0
- illuminate/log: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- monolog/monolog: ^3.0
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
README
A small Laravel logging driver for Datadog HTTP log intake.
Installation
composer require mpluskassa/laravel-datadog
Configuration
Add a Datadog channel to config/logging.php:
'datadog' => [ 'driver' => 'datadog', 'level' => env('LOG_LEVEL', 'debug'), ],
Enable it through your stack:
LOG_CHANNEL=stack LOG_STACK=single,datadog DATADOG_API_KEY=your-api-key
By default, the package sends logs to the EU intake endpoint and uses APP_NAME as the Datadog service name.
Optional env values:
DATADOG_HOST=https://http-intake.logs.datadoghq.eu DATADOG_SERVICE="${APP_NAME}" DATADOG_ENV="${APP_ENV}" DATADOG_TIMEOUT=2 DATADOG_CONNECT_TIMEOUT=1 DATADOG_THROW=false
Published Config
php artisan vendor:publish --tag=datadog-config
Behavior
- Sends logs to
{DATADOG_HOST}/api/v2/logs. - Adds the
DD-API-KEYheader. - Skips delivery when
DATADOG_API_KEYis empty. - Does not throw by default when Datadog is unavailable.
- Set
DATADOG_THROW=trueto throw delivery errors.
Example
Log::error('Something failed', [ 'order_id' => 123, ]);