santran/smartlogs
Composer 安装命令:
composer require santran/smartlogs
包简介
Create Smart Logs for Laravel 5 Web or API application.
README 文档
README
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...
santran/smartlogs 适用场景与选型建议
santran/smartlogs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27 次下载、GitHub Stars 达 0, 最近一次更新时间为 2016 年 11 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 santran/smartlogs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 santran/smartlogs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 27
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-17
