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)

0299PHPCI passing

Since Mar 31Pushed 1mo 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 1mo ago

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 37% of packages

Maintenance60

Regular maintenance activity

Popularity13

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity11

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://www.gravatar.com/avatar/a9f93ffdddb66911d93dfedd79a2a2ed6a14615ce8519333254dc1dd8a971ea1?d=identicon)[alexbaldo](/maintainers/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.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)
