15/12
2017
dev-master
9999999-devCustomizing Laravel Log
The Requires
by farzin fthi
Wallogit.com
2017 © Pedro Peláez
Customizing Laravel Log
easy way to Customizing laravel log. you can log with custom name, custom format and custom time., (*1)
Add package to your project, (*2)
composer require farzinft/flog:"dev-master"
add service provider:, (*3)
Flog\FlogServiceProvider::class
then publish config file, (*4)
php artisan vendor:publish --provider='Flog\FlogServiceProvider'
now in flog.php config file you can customize laravel logger and when, (*5)
you attempt to use log such as Log::info() the logger work as you expect parameters in flog.php configuration file., (*6)
return [ /** * Log Path */ 'log_path' => storage_path('logs/' . kebab_case(config('app.name')) . '.log'), /** * Log Format */ 'log_format' => "%datetime% [%level_name%] (%channel%): %message% %context%\n", /** * Daily Log Max Files */ 'max_files' => 5, /** * set jalali Date //for persian date */ 'jalali_date' => false ];
Customizing Laravel Log