How to Create Custom Log File in Laravel?

About Us:

We are from free coder. We are a group of web developers who are passionate about web development. You can learn from us php, laravel, node js, vue js, react js and many other topic on web developement.
we are very happy to help you.
free coder

Today what you are going to learn:

This lesson is focused on laravel custom log file name. This article goes in detailed on how to create custom log file in laravel. This article will give you simple lesson of laravel custom log file lesson. it's simple lesson of create custom log file in laravel. Follow bellow tutorial step of how to make custom log file laravel 6, laravel 7 and laravel 8 version.

Laravel by default provide storage/logs/laravel.log file location where it will display log file. but sometime you may require to create log file with specific task. for lesson if you are working with payment task and you need all logs separately log file for payment, so you can easily find out solution.

here, i will give you very simple lesson so let's see how to add custom channel with new log file location. add new key "itsolution" on "channels" array.



'channels' => [


'itsolution' => [

'driver' => 'single',

'path' => storage_path('logs/itsolution.log'),

'level' => 'info',



Route Code:

Route::get('create-custom-log', function () {

\Log::channel('itsolution')->info('This is testing for!');



now you can check your own.


[2021-04-13 11:46:41] local.INFO: This is testing for!

thank you very much for following up with me.


Recent Posts

Related Posts