PHPackages                             elrincondeisma/laravel-cloudwatch-logs - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. elrincondeisma/laravel-cloudwatch-logs

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

elrincondeisma/laravel-cloudwatch-logs
======================================

Laravel Adapter for AWS CloudWatch

18PHP

Since Mar 7Pushed 1y agoCompare

[ Source](https://github.com/elrincondeisma/laravel-cloudwatch-logs)[ Packagist](https://packagist.org/packages/elrincondeisma/laravel-cloudwatch-logs)[ RSS](/packages/elrincondeisma-laravel-cloudwatch-logs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Logger for Aws Cloud Watch
--------------------------

[](#logger-for-aws-cloud-watch)

### Breaking Change for version 1.0

[](#breaking-change-for-version-10)

When this package started, it started as a listener for log events and would only work with another channel. This package would listen to log events and just add extra log to cloud watch. So, you did not need to add cloudwatch as a `channel`. But after `1.0` it works as a custom driver. So, you MUST add `LOG_CHANNEL` as `cloudwatch` in your logging config for this to work going forward.

### Installation

[](#installation)

`composer require pagevamp/laravel-cloudwatch-logs`

### Example

[](#example)

You can use laravel's default `\Log` class to use this

`\Log::info('user logged in', ['id' => 123, 'name' => 'Naren']);`

### Usage with AWS Lambda

[](#usage-with-aws-lambda)

Make sure the AWS Lambda template contains an IAM role with enough access. So think about Logs:CreateLogGroup, Logs:DescribeLogGroups, Logs:CreateLogStream, Logs:DescribeLogStream, Logs:PutRetentionPolicy and Logs:PutLogEvents

### Config

[](#config)

Config for logging is defined at `config/logging.php`. Add `cloudwatch` to the `channels` array

```
'channels' =>  [
    'cloudwatch' => [
            'driver' => 'custom',
            'name' => env('CLOUDWATCH_LOG_NAME', ''),
            'region' => env('CLOUDWATCH_LOG_REGION', ''),
            'credentials' => [
                'key' => env('CLOUDWATCH_LOG_KEY', ''),
                'secret' => env('CLOUDWATCH_LOG_SECRET', '')
            ],
            'stream_name' => env('CLOUDWATCH_LOG_STREAM_NAME', 'laravel_app'),
            'retention' => env('CLOUDWATCH_LOG_RETENTION_DAYS', 14),
            'group_name' => env('CLOUDWATCH_LOG_GROUP_NAME', 'laravel_app'),
            'version' => env('CLOUDWATCH_LOG_VERSION', 'latest'),
            'formatter' => \Monolog\Formatter\JsonFormatter::class,
            'batch_size' => env('CLOUDWATCH_LOG_BATCH_SIZE', 10000),
            'via' => \Pagevamp\Logger::class,
        ],
]

```

And set the `LOG_CHANNEL` in your environment variable to `cloudwatch`.

If the role of your AWS EC2 instance has access to Cloudwatch logs, `CLOUDWATCH_LOG_KEY` and `CLOUDWATCH_LOG_SECRET` need not be defined in your `.env` file.

### Contribution

[](#contribution)

I have added a `pre-commit` hook to run `php-cs-fixer` whenever you make a commit. To enable this run `sh hooks.sh`.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity17

Early-stage or recently created project

 Bus Factor1

Top contributor holds 70.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7858f1e3103562eaffd107ca3616094abd9dd44bc97d387aa923fa9042a0c938?d=identicon)[icatala](/maintainers/icatala)

---

Top Contributors

[![developernaren](https://avatars.githubusercontent.com/u/3628468?v=4)](https://github.com/developernaren "developernaren (33 commits)")[![FoxxMD](https://avatars.githubusercontent.com/u/4663766?v=4)](https://github.com/FoxxMD "FoxxMD (4 commits)")[![rmundel](https://avatars.githubusercontent.com/u/13142574?v=4)](https://github.com/rmundel "rmundel (2 commits)")[![elrincondeisma](https://avatars.githubusercontent.com/u/50373238?v=4)](https://github.com/elrincondeisma "elrincondeisma (2 commits)")[![nexus-claw](https://avatars.githubusercontent.com/u/266272549?v=4)](https://github.com/nexus-claw "nexus-claw (2 commits)")[![naveenk87](https://avatars.githubusercontent.com/u/7149360?v=4)](https://github.com/naveenk87 "naveenk87 (1 commits)")[![luigel](https://avatars.githubusercontent.com/u/26235960?v=4)](https://github.com/luigel "luigel (1 commits)")[![niekvanderkooy](https://avatars.githubusercontent.com/u/1261369?v=4)](https://github.com/niekvanderkooy "niekvanderkooy (1 commits)")[![Martenvanurk](https://avatars.githubusercontent.com/u/747146?v=4)](https://github.com/Martenvanurk "Martenvanurk (1 commits)")

### Embed Badge

![Health badge](/badges/elrincondeisma-laravel-cloudwatch-logs/health.svg)

```
[![Health](https://phpackages.com/badges/elrincondeisma-laravel-cloudwatch-logs/health.svg)](https://phpackages.com/packages/elrincondeisma-laravel-cloudwatch-logs)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
