ravaelles/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 not auto-updated.

Last update: 2024-12-14 19:29:59 UTC


README

Forked from shallowman/laravel-filebeat

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,
];