daunoanove/lumen-request-log

This package is abandoned and no longer maintained. No replacement package was suggested.

1.0.3 2021-05-10 19:01 UTC

This package is auto-updated.

Last update: 2021-05-10 19:15:11 UTC


README

Log every request and response of Lumen PHP Framework.

Installation

$ composer require malvik-lab/lumen-request-log-middleware

Registering Middleware

bootstrap/app.php
$app->middleware([
    MalvikLab\LumenRequestLogMiddleware::class,
]);

Set REQUEST_LOG_CHANNEL

.env
REQUEST_LOG_CHANNEL="request-log"

Set logging

config/logging.php
return [
    'channels' => [
        'request-log' => [
            'driver' => 'daily',
            'path' => storage_path('logs/' . php_sapi_name() . '/requests.log'),
            'days' => 30,
        ],
    ],
];