santran/smartlogs
Laravel 5 SmartLogs
Log look like

The best Log for Laravel 5.2.x and above. Install with composer.
Install (Laravel)
Install via composer
composer require santran/smartlogs:dev-master
Add Service Provider to config/app.php in providers section
SanTran\SmartLogs\SmartLogsServiceProvider::class,
Add Facade to config/app.php in aliases section:
'SmartLogs' => SanTran\SmartLogs\SmartLogsFacade::class,
Publish config file, open console and enter bellow command:
php artisan vendor:publish
Config file 'smartlogs.php' will be copy to config/smartlogs.php, you can change any config on that file for SmartLogs
- 'log_path' : Path to save file log
- 'log' : Log daily or single file
- 'log_option_on' : Enable/Disable Option Log
- 'log_level_enable' : Level of logs (Have four Level 'DEBUG', 'INFO', 'WARNING', 'ERROR')
- 'log_file_name' : Name of file log
- 'log_condition' => true, : Enable Log by user id or client IP
- 'list_user_id' => [1, 2] : List user id accept to write log
- 'list_ip' => ['127.0.0.1', '::1'] : List IP accept to write log
- 'log_reverse' => false, : Reverse condition write lo by user id and client ip
How to use ? Open your Controller or any where you want to write log. Add this line on above file, remember after 'namespace ...' keywork:
use SmartLogs;
Call to write log on your function:
SmartLogs::startLog($params) : To write START log ($params is optional - Default is "START")
SmartLogs::finishLog($params) : To write FINISH log ($params is optional - Default is "FINISH")
SmartLogs::appInfo($params) : To write Information log ($params can be String or Array)
SmartLogs::appDebug($params) : To write Debug log ($params can be String or Array)
SmartLogs::appWarning($params) : To write Warning log ($params can be String or Array)
SmartLogs::appError($params) : To write Error log ($params can be String or Array)
SmartLogs::optLog($params) : To write Option log ($params can be String or Array)
SmartLogs::logRequest() : To write Option log with all Request params
Features:
- Update auto log lastest sql command
- And more...
Related Packages
Powerful PHP database abstraction layer (DBAL) with many features for database s...
Laravel Serializable Closure provides an easy and secure way to serialize closur...
Cli error handling for console/command-line PHP applications.
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| 1.0 | >=5.5.9 | MIT |
