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

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

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

plumthedev/laravel-cloudwatch-logger

Composer 安装命令:

composer require plumthedev/laravel-cloudwatch-logger

包简介

Laravel Cloudwatch Logger is a Laravel package providing seamless integration with AWS CloudWatch for logging.

README 文档

README

PHP Laravel PhpStorm

quality check tests coverage

Laravel Cloudwatch Logger is a Laravel package that provides integration with AWS CloudWatch for logging.

Installation

You can install the package via composer:

composer require plumthedev/laravel-cloudwatch-logger

Configuration

This package allows you to configure AWS CloudWatch logging settings either globally or per channel.

Global Configuration

If the logging.cloudwatch key is not present in your Laravel configuration, the package merges the following default configuration into the global logging configuration:

Configuration Key Description Env Name Default Value
logging.cloudwatch.name Name of the CloudWatch log channel CLOUDWATCH_LOGGER_NAME Laravel Cloudwatch Logger
logging.cloudwatch.region AWS region for CloudWatch logging CLOUDWATCH_LOGGER_REGION eu-central-1
logging.cloudwatch.version AWS SDK version CLOUDWATCH_LOGGER_VERSION latest
logging.cloudwatch.credentials.key AWS access key for authentication CLOUDWATCH_LOGGER_CREDENTIALS_KEY
logging.cloudwatch.credentials.secret AWS secret key for authentication CLOUDWATCH_LOGGER_CREDENTIALS_SECRET
logging.cloudwatch.group_name Default log group name CLOUDWATCH_LOGGER_GROUP_NAME Your App Name
logging.cloudwatch.stream_name Default log stream name CLOUDWATCH_LOGGER_STREAM_NAME Your App Name
logging.cloudwatch.retention_days Number of days to retain log events CLOUDWATCH_LOGGER_RETENTION_DAYS 14
logging.cloudwatch.batch_size Maximum number of log events to send in one batch CLOUDWATCH_LOGGER_BATCH_SIZE 25

Channel Configuration

You can also override or specify additional configuration options for specific logging channels. For example:

// config/logging.php

'channels' => [
    ...
    'cloudwatch' => [
        'driver' => 'cloudwatch',
        'group_name' => 'api_v1',
        'stream' => 'V1 Payments Logger',
    ],
],

'cloudwatch' => [
   'name' => 'Laravel App',
   'group_name' => 'api',
   'stream' => 'component',
   'credentials' => [
        'key' => '...',
        'secret' => '...',
    ],
],

In the channel configuration, you can define specific settings such as the log group name (group_name) and log stream name (stream_name). These settings will override the corresponding global configuration values for the CloudWatch logging driver. While credentials will keep the same.

Testing

To run tests, you need to build a Docker image first:

make build

Only then you can execute the tests:

make test

Contribution

If you spot areas for improvement, wish to make enhancements, or have ideas for further development, feel free to contribute to this project.

To access the project terminal, you must first build the Docker image:

make build

Afterward, you can enter the console:

make run

Before submitting a pull request, ensure everything is in order:

make check

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

plumthedev/laravel-cloudwatch-logger 适用场景与选型建议

plumthedev/laravel-cloudwatch-logger 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 668 次下载、GitHub Stars 达 3, 最近一次更新时间为 2024 年 03 月 13 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「logger」 「aws」 「laravel」 「integration」 「cloudwatch」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 plumthedev/laravel-cloudwatch-logger 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 plumthedev/laravel-cloudwatch-logger 我们能提供哪些服务?
定制开发 / 二次开发

基于 plumthedev/laravel-cloudwatch-logger 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-13