LaravelPackages.net
Acme Inc.
Toggle sidebar
alexeyshchetkin/laravel-http-client-logger

7
1
1.0
About alexeyshchetkin/laravel-http-client-logger

alexeyshchetkin/laravel-http-client-logger is a Laravel package. It currently has 1 GitHub stars and 7 downloads on Packagist (latest version 1.0). Install it with composer require alexeyshchetkin/laravel-http-client-logger. Discover more Laravel packages by alexeyshchetkin or browse all Laravel packages to compare alternatives.

Last updated

Laravel Http Client Logger

Laravel Http Client Logger - library for logging connection/request/response actions for Laravel HTTP Client

Installation

You can install the package via composer:

composer require alexeyshchetkin/laravel-http-client-logger

You can publish the config file with:

php artisan vendor:publish --provider="AlexeyShchetkin\LaravelHttpClientLogger\Providers\HttpClientLoggerServiceProvider" --tag="laravel-http-client-logger"

The contents of the published config file:

return [
    /*
     * Channel name for logging
     */
    'channel_name' => 'external_requests',
    /*
     * Channel log level
     */
    'log_level' => 'info',
    /*
     * Channel configuration in Laravel style
     */
    'channel_configuration' => [
        'driver' => 'daily',
        'path' => storage_path('logs/external_requests.log'),
        'formatter' => JsonFormatter::class,
        'level' => env('LOG_LEVEL', 'info'),
        'days' => 7,
    ],
    /*
     * Http client events for logging (comment not needed, add own if needed)
     */
    'events' => [
        ConnectionFailed::class => ConnectionFailedListener::class,
        RequestSending::class => RequestSendingListener::class,
        ResponseReceived::class => ResponseReceivedListener::class,
    ],
];

License

The MIT License (MIT).

Comments