shallowman/laravel-filebeat

The middleware for application log with json format and correspond to filebeat log collection

v1.3.0 2019-01-15 03:18 UTC

This package is auto-updated.

Last update: 2020-11-20 08:12:21 UTC


README

Installation

Require the shallowman/laravel-filebeat package in your composer.json and update your dependencies:

$ composer require shallowman/laravel-filebeat

For laravel >=5.5 that's all. This package supports Laravel new Package Discovery.

Configuration

The defaults are set in config/app-log.php. Copy this file to your own config directory to modify the values. You can publish the config using this command:

$ php artisan vendor:publish --provider="Shallowman\Log\ServiceProvider"

Note: If you want to rewrite the log path please provide a real path.

return [
    'channels' => [
        'filebeat' => [
            'driver' => 'daily',
            'path' => env('APP_LOG_PATH', '/application/logs/app.log'),
            'tap' => [Shallowman\Log\LogFormatter::class],
            'days' => 7,
        ],
    ],
];

Add the HandleApplicationLog middleware in the $middleware property of app/Http/Kernel.php class:

protected $middleware = [
    // ...
    \Shallowman\Log\HandleApplicationLog::class,
];