wndr/laravel-cloudwatch-tail
最新稳定版本:1.0.0
Composer 安装命令:
composer require wndr/laravel-cloudwatch-tail
包简介
Tail Laravel log files and ship them to AWS CloudWatch Logs
README 文档
README
Tail Laravel log files and ship them to AWS CloudWatch Logs.
Installation
composer require wndr/laravel-cloudwatch-tail
Configuration
Publish the configuration file:
php artisan vendor:publish --tag=cloudwatch-tail-config
Environment Variables
Configure the following environment variables:
CLOUDWATCH_LOG_GROUP_NAME=your-log-group-name CLOUDWATCH_LOG_REGION=eu-west-1 CLOUDWATCH_LOG_KEY=your-aws-key CLOUDWATCH_LOG_SECRET=your-aws-secret
If CLOUDWATCH_LOG_KEY and CLOUDWATCH_LOG_SECRET are not set, the AWS SDK will use the default credential provider chain (IAM roles, environment variables, etc.).
Usage
Run the command to start shipping logs:
php artisan cloudwatch:ship-logs
Options
| Option | Default | Description |
|---|---|---|
--dir |
storage/logs |
Directory to watch for log files |
--pattern |
*.log |
File pattern to match |
--group |
Config value | CloudWatch Log Group name |
--cursor |
cloudwatch-cursors.json |
Cursor file (only used when cleanup is disabled) |
--flush-seconds |
60 |
Flush interval in seconds |
--max-bytes |
900000 |
Max batch bytes per stream before flush |
--refresh-seconds |
120 |
How often to rescan directory for new files |
--sleep-ms |
200 |
Loop sleep when idle (milliseconds) |
--cleanup-after-ship |
true |
Truncate shipped files and delete old rotated logs |
License
MIT
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-19