PHP code example of santran / smartlogs

1. Go to this page and download the library: Download santran/smartlogs library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

santran / smartlogs example snippets


SanTran\SmartLogs\SmartLogsServiceProvider::class,
 
'SmartLogs' => SanTran\SmartLogs\SmartLogsFacade::class,

php artisan vendor:publish

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

use SmartLogs;

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