PHPackages                             alexbaldo/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. alexbaldo/laravel-cloudwatch-logs

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

alexbaldo/laravel-cloudwatch-logs
=================================

Laravel Adapter for AWS CloudWatch (comp. with Laravel 13)

0452PHPCI passing

Since Mar 31Pushed 3mo agoCompare

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

READMEChangelogDependenciesVersions (1)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

25

—

LowBetter than 35% of packages

Maintenance55

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 60% 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://avatars.githubusercontent.com/u/4295624?v=4)[Alejandro Baldominos](/maintainers/alexbaldo)[@alexbaldo](https://github.com/alexbaldo)

---

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)")[![priosshrsth](https://avatars.githubusercontent.com/u/30313649?v=4)](https://github.com/priosshrsth "priosshrsth (2 commits)")[![hungnv-sr](https://avatars.githubusercontent.com/u/25086528?v=4)](https://github.com/hungnv-sr "hungnv-sr (2 commits)")[![alexbaldo](https://avatars.githubusercontent.com/u/4295624?v=4)](https://github.com/alexbaldo "alexbaldo (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![rmundel](https://avatars.githubusercontent.com/u/13142574?v=4)](https://github.com/rmundel "rmundel (2 commits)")[![KentarouTakeda](https://avatars.githubusercontent.com/u/4785040?v=4)](https://github.com/KentarouTakeda "KentarouTakeda (2 commits)")[![sujansh](https://avatars.githubusercontent.com/u/1407947?v=4)](https://github.com/sujansh "sujansh (1 commits)")[![jamesbhatta](https://avatars.githubusercontent.com/u/24622175?v=4)](https://github.com/jamesbhatta "jamesbhatta (1 commits)")[![luigel](https://avatars.githubusercontent.com/u/26235960?v=4)](https://github.com/luigel "luigel (1 commits)")[![Martenvanurk](https://avatars.githubusercontent.com/u/747146?v=4)](https://github.com/Martenvanurk "Martenvanurk (1 commits)")[![naveenk87](https://avatars.githubusercontent.com/u/7149360?v=4)](https://github.com/naveenk87 "naveenk87 (1 commits)")[![niekvanderkooy](https://avatars.githubusercontent.com/u/1261369?v=4)](https://github.com/niekvanderkooy "niekvanderkooy (1 commits)")

### Embed Badge

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

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B11.5k](/packages/psr-log)[open-telemetry/api

API for OpenTelemetry PHP.

1941.5M276](/packages/open-telemetry-api)[open-telemetry/sdk

SDK for OpenTelemetry PHP.

2328.5M343](/packages/open-telemetry-sdk)

PHPackages © 2026

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