javvlon/laravel-google-chat-logger
Composer 安装命令:
composer require javvlon/laravel-google-chat-logger
包简介
A Laravel package for logging errors to Google Chat
README 文档
README
Laravel Google Chat Logger is a simple package that integrates Google Chat logging with Laravel. It sends logs directly to a Google Chat room using a webhook, making it easy to track errors or important events in your Laravel application.
Features
- Send Laravel logs to a Google Chat space via webhook
- Customizable logging level (error, warning, info, etc.)
- Simple setup and configuration
Installation
Step 1: Install the Package via Composer
To install the package, add it to your composer.json or install it directly via the command line:
composer require javvlon/laravel-google-chat-logger
Configuration
After installing the package, you need to configure your logging channels. To do this, open your config/logging.php file and add the google_chat channel configuration:
'channels' => [
// Other log channels...
'google_chat' => [
'driver' => 'google_chat',
'webhook_url' => env('GOOGLE_CHAT_WEBHOOK_URL'),
'level' => 'error', // You can set the desired log level: debug, info, notice, warning, error, critical, alert, emergency
],
],
Environment Variables
You must add your Google Chat webhook URL to your .env file:
GOOGLE_CHAT_WEBHOOK_URL=https://chat.googleapis.com/v1/spaces/your-space/messages?key=your-key&token=your-token
Usage
Once configured, Laravel will automatically send any logs to Google Chat using the specified channel. You can use the google_chat channel to log errors:
Log::channel('google_chat')->error('This is a test error log message.');
Customization
You can adjust the logging level in the logging.php configuration to filter what types of logs are sent to Google Chat.
For example, to log only warnings and above:
'level' => 'warning',
License
The MIT License (MIT). Please see License File for more information.
Contributing
Feel free to open issues or submit pull requests to improve the functionality. We welcome contributions!
Support
If you encounter any issues or need assistance, feel free to open a GitHub issue.
javvlon/laravel-google-chat-logger 适用场景与选型建议
javvlon/laravel-google-chat-logger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.08k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 09 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 javvlon/laravel-google-chat-logger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 javvlon/laravel-google-chat-logger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-26