Looking to hire Laravel developers? Try LaraJobs

laravel-datadog maintained by mpluskassa

Description
A Laravel logging driver for Datadog HTTP log intake.
Last update
2026/06/29 16:35 (dev-main)
License
Links
Downloads
0

Comments
comments powered by Disqus

Laravel Datadog Logger

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-KEY header.
  • Skips delivery when DATADOG_API_KEY is empty.
  • Does not throw by default when Datadog is unavailable.
  • Set DATADOG_THROW=true to throw delivery errors.

Example

Log::error('Something failed', [
    'order_id' => 123,
]);