mikegarde/laravel-datadog-batched

0.3.0 2020-12-14 15:47 UTC

This package is auto-updated.

Last update: 2024-11-15 01:10:21 UTC


README

Using Composer/Packagist

composer install laravel-datadog-batched

config/app.php

return [
    'providers' => [
        MikeGarde\LaravelDataDogBatched\DataDogServiceProvider::class,
    ],
    
    'aliases' => [
        'DataDog' => MikeGarde\LaravelDataDogBatched\DataDogFacade::class,
    ],
];

app/Http/Kernel.php

protected $middleware = [
    \MikeGarde\LaravelDataDogBatched\DataDogMiddleware::class,
];

config/datadog.php

php artisan vendor:publish --provider="MikeGarde\LaravelDataDogBatched\DataDogServiceProvider"

Review the config and name the prefix appropriately

Tip: enable or disable based on environment

return [
	'enabled'         => (env('APP_ENV') === 'prod' || env('APP_ENV') === 'qa'),
	'prefix'          => 'app.APIv2',
];

config/doctrine.php

If desired to log SQL interactions and duration

return [
    'logger' => \MikeGarde\LaravelDataDogBatched\FileLogger::class,
];