toshkq93/laravel-logger is a Laravel package for logging for laravel src/routes.
It currently has 0 GitHub stars and 5 downloads on Packagist (latest version 1.0.4).
Install it with composer require toshkq93/laravel-logger.
Discover more Laravel packages by toshkq93
or browse all Laravel packages to compare alternatives.
Last updated
Install the package via composer
composer require toshkq93/laravel-logger
Toshkq93\Logger\Providers\LoggerServiceProvider::class
php artisan vendor:publish --provider="Toshkq93\Logger\Providers\LoggerProvider"
By default the logger will use file to log the data.
Route::group([
'middleware' => 'logger',
], function (){
Route::post('/start', 'start');
});
Saving data will be stable along the way storage/logs/{NAME_YOUR_PROJECT}. If you want to split a folder into several routes, you need to create a class with variable constants along the path. Example:
class LoggerName
{
const TELEPHONY = 'telephony';
const USER = 'user';
const CHAT = 'chat';
const FILE = 'file';
}
And add in group route:
Route::group([
'middleware' => 'logger',
'group' => LoggerNameEnum::TELEPHONY
],function (){
Route::post('/start', 'start');
Route::post('/finish', 'finish');
});
And when you go along these paths of the route, then along the way storage/logs/{NAME_YOUR_PROJECT}/{LoggerNameEnum::TELEPHONY}
If you get an error, then a file called error.log will be created, if everything is fine, then success.log
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.