sudo/monitoring-logs
Composer 安装命令:
composer require sudo/monitoring-logs
包简介
Sudo monitor log package
README 文档
README
Giới thiệu: Đây là package dùng để ghi log vào Hệ thống giám sát tác vụ Sudo.
Mặc định package giúp gửi log về cho Hệ thống giám sát tác vụ Sudo để tiện theo dõi
Cài đặt để sử dụng
Chạy các lệnh:
composer require sudo/monitoring-logs
php artisan vendor:publish --provider="Sudo\MonitoringLog\Providers\SudoMonitoringLogServiceProvider"
Cấu hình tham số
Tại config/SudoMonitoringLog.php sẽ có nội dung như sau:
return [ 'host' => env('MONITORING_LOG_HOST', 'https://monitoring.sudo.vn'), 'token' => env('MONITORING_LOG_TOKEN', ''), ];
Cần sửa 2 tham số tại .env:
- MONITORING_LOG_HOST: Host hệ thống giám sát. Mặc định:
https://monitoring.sudo.vn - MONITORING_LOG_TOKEN: Token truy cập API mà hệ thống giám sát cung cấp
SudoMonitoringLog API
Các function ghi log được tích hợp sẵn tại class SudoMonitoringLog:
-
Ghi log khi job thực hiện thành công:
/** * Ghi trạng thái log thành công * @param integer $job_item_id ID job trên hệ thống giám sát * @param string $message Nội dung cần thông báo * @param string $title_link Link khi click vào thông báo */ SudoMonitoringLog::success($job_item_id, $message, $title_link="")
-
Ghi log khi job thực hiện xảy ra lỗi:
/** * Ghi trạng thái log lỗi * @param integer $job_item_id ID job trên hệ thống giám sát * @param string $message Nội dung cần thông báo * @param string $title_link Link khi click vào thông báo */ SudoMonitoringLog::error($job_item_id, $message, $title_link="")
统计信息
- 总下载量: 240
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-27