farzinft/flog

There is no license information available for the latest version (dev-master) of this package.

Customizing Laravel Log

dev-master 2017-12-15 22:08 UTC

This package is auto-updated.

Last update: 2024-04-18 02:07:30 UTC


README

easy way to Customizing laravel log. you can log with custom name, custom format and custom time.

Usage

Add package to your project

composer require farzinft/flog:"dev-master"

add service provider:

Flog\FlogServiceProvider::class

then publish config file

php artisan vendor:publish --provider='Flog\FlogServiceProvider'

now in flog.php config file you can customize laravel logger and when

you attempt to use log such as Log::info() the logger work as you expect parameters in flog.php configuration file.


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
];