tarfin-labs/laravel-cloudwatch-logger 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tarfin-labs/laravel-cloudwatch-logger

最新稳定版本:v2.7.0

Composer 安装命令:

composer require tarfin-labs/laravel-cloudwatch-logger

包简介

Laravel logger for AWS Clouldwatch Log service.

README 文档

README

Laravel logger factory for AWS Cloudwatch Logs service.

Installation

You can install the package via composer:

composer require tarfin-labs/laravel-cloudwatch-logger

Usage

Config parameters for logging are defined at config/logging.php.

You need to add new channel as cloudwatch and copy params inside config/config.php into it.

'channels' => [
    ...

    'cloudwatch' => [
        'driver' => 'custom',
        'via' => \TarfinLabs\LaravelCloudWatchLogger\LaravelCloudWatchLoggerFactory::class,
        'aws' => [
            'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
            'version' => 'latest',
            'credentials' => [
                'key' => env('AWS_ACCESS_KEY_ID'),
                'secret' => env('AWS_SECRET_ACCESS_KEY'),
            ],
        ],
        'name' => env('CLOUDWATCH_LOG_NAME', ''),
        'group' => env('CLOUDWATCH_LOG_GROUP_NAME', env('APP_NAME') . '-' . env('APP_ENV')),
        'stream' => env('CLOUDWATCH_LOG_STREAM', 'default'),
        'retention' => env('CLOUDWATCH_LOG_RETENTION', 7),
        'level' => env('CLOUDWATCH_LOG_LEVEL', 'error'),
        'extra' => [        // In case there's extra information to be logged
            'env' => env('APP_ENV'),
            'php' => PHP_VERSION,
            'laravel' => app()->version(),
        ],
    ],
],

Change the log channel inside .env file with cloudwatch.

LOG_CHANNEL=cloudwatch

You can use Laravel's default Log class to send your logs to CloudWatch.

\Illuminate\Support\Facades\Log::info('user logged in successfully', [
    'id' => 1,
    'username' => 'JohnDoe',
    'ip' => '127.0.0.1',
]);

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email development@tarfin.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 132.31k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 6
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固