sagar290/laravel-logable

This package is used for logging every incoming http route request.

v1.0.1 2022-02-03 19:53 UTC

This package is auto-updated.

Last update: 2024-09-29 06:03:15 UTC


README

Requirements

php >= 7.4

Laravel version >= 6.0

Installation

composer require sagar290/laravel-logable

You need add this configuration in config/logging.php file in channels array.

'channels' => [
    .....
    'logable' => [
        'driver' => 'daily',
        'path' => storage_path('logs/logable.log'),
        'level' => 'debug',
    ],
]

Add this middleware to your app/Http/Kernel.php file.

protected $middleware = [
    ...
    \Sagar290\Logable\Middleware\RouteLogMiddleware::class,
];

Publish configuration file.

php artisan vendor:publish --provider="Sagar290\Logable\LogableServiceProvider" --tag="config"

Commands

monitoring logs

php artisan logs:monitor

image laravel logable

This will live monitor all incoming requests and log them to the log file.

Clear logs

php artisan logs:clear

This will clear all logs.

Conclusion

Please feel free raise an issue if you have problem. Also, feel free to star this repository on Github. Contribute to this project by making a pull request.