PHPackages                             chrisguitarguy/monolog-ecs - 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. chrisguitarguy/monolog-ecs

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

chrisguitarguy/monolog-ecs
==========================

AWS ECS metadata in your log messages

v0.1.0(8y ago)131[1 PRs](https://github.com/chrisguitarguy/monolog-ecs/pulls)MITPHPPHP ~7.1

Since Mar 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/chrisguitarguy/monolog-ecs)[ Packagist](https://packagist.org/packages/chrisguitarguy/monolog-ecs)[ RSS](/packages/chrisguitarguy-monolog-ecs/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

Monolog ECS
===========

[](#monolog-ecs)

A set of monolog processors that add some additional context to Monolog's `extra` key of the `$record`.

More pratically speaking, these allow users to put information in logs about the servers or ECS tasks from which the log messages were generated.

The values available are pulled from the [Container Metadata File](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container-metadata.html)and are all the file keys prefixed with `aws_ecs_`. See below for some examples

Installation
------------

[](#installation)

```
composer require chrisguitarguy/monolog-ecs

```

Usage
-----

[](#usage)

```
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Chrisguitarguy\MonologEcs\AwsEcsProcessor;

$logger = new Logger('myapp');
// add the processor, `::create()` uses the default dependencies that loads
// metadata from the file and caches it based on the file status
$logger->pushProcessor(AwsEcsProcessor::create());

// now use the various `%extra.aws_ecs_*` values as desired. These are all
// keys from the metadata file lowercased and prefixed with `aws_ecs_`
$handler = new StreamHandler('php://stdout');
$handler->setFormatter(new LineFormatter(
  '[%datetime%] %channel%.%level_name%: %message% (%extra.aws_ecs_taskarn%, %extra.aws_ecs_containerinstancearn%)'
));

$logger->pushHandler($handler);
```

The above example will include the ECS task's ARN as well as the ARN of the instance on which is the task is running.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3032d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d396af79150164dd4d28f3e816b377e2f3c04df431d8338477517efa0013664c?d=identicon)[chrisguitarguy](/maintainers/chrisguitarguy)

---

Top Contributors

[![chrisguitarguy](https://avatars.githubusercontent.com/u/1010392?v=4)](https://github.com/chrisguitarguy "chrisguitarguy (7 commits)")

---

Tags

awsmonologECS

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chrisguitarguy-monolog-ecs/health.svg)

```
[![Health](https://phpackages.com/badges/chrisguitarguy-monolog-ecs/health.svg)](https://phpackages.com/packages/chrisguitarguy-monolog-ecs)
```

###  Alternatives

[maxbanton/cwh

AWS CloudWatch Handler for Monolog library

42516.0M35](/packages/maxbanton-cwh)[phpnexus/cwh

AWS CloudWatch Handler for Monolog library

403.7M7](/packages/phpnexus-cwh)[bref/monolog-bridge

Monolog formatter optimized for AWS Lambda and CloudWatch

111.8M5](/packages/bref-monolog-bridge)[pkerrigan/xray

A basic PHP instrumentation library for AWS X-Ray

601.6M3](/packages/pkerrigan-xray)[logtail/monolog-logtail

Logtail handler for Monolog

243.6M3](/packages/logtail-monolog-logtail)[staabm/phpstan-psr3

23696.2k4](/packages/staabm-phpstan-psr3)

PHPackages © 2026

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