Laravel Create Custom Log File Tutorial
Jun 03, 2021 . Admin

Hi Guys,
Today, i will explain you how to integrate custom own log file in laravel. in this article i will discuss how to create custom log file in laravel.
In this laravel provide a own log file located inside the storage/logs/laravel.log
Here, i will give you a simple example of log file first of all how to integrate custom channel with new log file location.
So let's start to the example and follow to the my all step.
Path : config/logging.php... 'channels' => [ ... 'mywebtuts' => [ 'driver' => 'single', 'path' => storage_path('logs/mywebtuts.log'), 'level' => 'info', ], ....
In your web.php file
Path : routes/web.phpRoute::get('custom-log',function(){ \Log::channel('mywebtuts')->info('This is Testing From My Side.'); dd('Done'); });
now you can check for this code.
Path : storage/logs/mywebtuts.log[2021-06-03 05:27:50] local.INFO: This is Testing From My Side.
It will help you...