mrsantran / smartlogs by santran

Create Smart Logs for Laravel 5 Web or API application.
26
0
1
Package Data
Maintainer Username: santran
Maintainer Contact: santran686@gmail.com (San Tran)
Package Create Date: 2016-11-17
Package Last Update: 2018-04-21
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-26 15:15:25
Package Statistics
Total Downloads: 26
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

Laravel 5 SmartLogs

Total Downloads Paypal Donate

Log look like preview


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...