New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

betalabs/laravel-cloudwatch-logs

Laravel Adapter for AWS CloudWatch
4,097 1
Install
composer require betalabs/laravel-cloudwatch-logs
Latest Version:v2.0.0
PHP:^8.2
Laravel:10 · 11 · 12
Older releases:5 – 9
License:MIT
Last Updated:Oct 22, 2026
Links: GitHub  ·  Packagist
Maintainer: diego-betalabs

Logger for Aws Cloud Watch

Example

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

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

Configs

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

'channels' =>  [
    'cloudwatch' => [
            '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'),
        ],
]

Add correct values to keys in your .env file. And it should work.

Add To Project

Laravel 5.5 or Higher

This package uses laravel's Package discovery. To disable this package by default you can add DISABLE_CLOUDWATCH_LOG=true to you local .env file and this package will be disabled.

Laravel 5.4 or Lower

Add to the providers array in config/app.php:

Pagevamp\Providers\CloudWatchServiceProvider::class

Concept

This package relies on laravel's listener for log events. This package DOES NOT replace the default logging, instead adds additional log to AWS CLoud Watch. Hence you do not have to change the default log driver to make this work.

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.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released PHP Laravel License
v2.0.0 ^8.2 ^10.0 || ^11.0 || ^12.0 MIT
1.0.4 ^5.1 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0 MIT
1.0.3 ^5.1 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 MIT
1.0.2 ^5.1 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 MIT
1.0.1 ^5.1 || ^6.0 || ^7.0 || ^8.0 || ^9.0 MIT