PHPackages                             bref/monolog-bridge - 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. bref/monolog-bridge

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

bref/monolog-bridge
===================

Monolog formatter optimized for AWS Lambda and CloudWatch

1.0.1(11mo ago)111.2M—2.7%2MITPHPPHP &gt;=8.0CI passing

Since Jun 14Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/brefphp/monolog-bridge)[ Packagist](https://packagist.org/packages/bref/monolog-bridge)[ GitHub Sponsors](https://github.com/mnapoli)[ RSS](/packages/bref-monolog-bridge/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (3)Used By (2)

This repository provides a **Monolog log formatter optimized for AWS Lambda and CloudWatch**.

Read all about logs [in the Bref documentation](https://bref.sh/docs/environment/logs).

---

Logs will be formatted to combine readability and structured data, making it easy to both read logs and filter them. Here's an example of a log record:

```
INFO   This is a log message   {"message":"This is a log message","level":"INFO"}

```

The JSON object contains the following fields (when applicable):

```
{
    "message": "Uncaught exception: 'RuntimeException' with message 'Exception message'",
    "level": "ERROR",
    "exception": {
        "class": "RuntimeException",
        "message": "Exception message",
        "code": 0,
        "file": "/var/task/index.php:11",
        "trace": [ ... ]
    },
    "context": {
        "key": "value",
        ...
    },
    "extra": {
        "key": "value",
        ...
    }
}
```

The JSON object is parsed by CloudWatch, allowing you to filter logs in CloudWatch Logs Insights. For example:

```
fields @timestamp, @message
| filter level = 'ERROR'
| filter exception.class = 'RuntimeException'
| sort @timestamp desc
| limit 1000

```

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

[](#installation)

Important

This package is already installed if you use Bref's [Laravel bridge](https://bref.sh/docs/laravel/getting-started) or [Symfony bridge](https://bref.sh/docs/symfony/getting-started). If you do, you don't need to install this package.

```
composer require bref/monolog-bridge
```

Usage
-----

[](#usage)

For Laravel applications, set the following environment variable in `serverless.yml`:

```
provider:
    environment:
        LOG_STDERR_FORMATTER: Bref\Monolog\CloudWatchFormatter
```

For Symfony applications, set the Bref Monolog formatter in your `config/packages/prod/monolog.yaml`:

```
monolog:
    handlers:
        file:
            type: stream
            level: info
            formatter: 'Bref\Monolog\CloudWatchFormatter'
```

For other applications, you can set the formatter in your Monolog configuration. For example:

```
$handler = new Monolog\Handler\StreamHandler('php://stderr', Monolog\Logger::INFO);
$handler->setFormatter(new Bref\Monolog\CloudWatchFormatter);
$logger = new Monolog\Logger('default');
$logger->pushHandler($handler);
```

Motivation
----------

[](#motivation)

The goal of this is to improve the overall logs experience with CloudWatch.

The usual format is to log unstructured text. This sucks because:

- we can't filter by log level (e.g. look for errors)
- we can't easily filter and see all logs of a request/invocation via the AWS request ID (e.g. as log metadata)
- some log messages are split across multiple lines
- exception traces especially are split across loads of lines, not easy to navigate in CloudWatch or other line-based viewers

Here's an example:

[![Screen-002902](https://private-user-images.githubusercontent.com/720328/455018505-38571928-77e5-41bc-a2ea-f67435ce720b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDE4NTA1LTM4NTcxOTI4LTc3ZTUtNDFiYy1hMmVhLWY2NzQzNWNlNzIwYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwM1QyMjM2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yNTYxMjgwMTQzOGQxMWY3MjZkMjg3Y2RlOGMxMDFiOTkxYTgxYTc2YzlmMTNkN2NiOGY0NTc5MzFhYzhhOWE3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.yjy6Qk67pMkES9DnmtcRafflt49rMzPYAMxBk1pR3aY)](https://private-user-images.githubusercontent.com/720328/455018505-38571928-77e5-41bc-a2ea-f67435ce720b.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDE4NTA1LTM4NTcxOTI4LTc3ZTUtNDFiYy1hMmVhLWY2NzQzNWNlNzIwYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwM1QyMjM2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yNTYxMjgwMTQzOGQxMWY3MjZkMjg3Y2RlOGMxMDFiOTkxYTgxYTc2YzlmMTNkN2NiOGY0NTc5MzFhYzhhOWE3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.yjy6Qk67pMkES9DnmtcRafflt49rMzPYAMxBk1pR3aY)

A better approach is to switch to JSON-formatted logs:

- we can add metadata to log records (e.g. request ID to filter/see all logs of a request, or filter by log level)
- exception traces are organized as sub-metadata of the exception record, keeping things easier to navigate

But this isn't perfect:

- depending on the tool you use to view the logs, the UX can be very very poor
- it's hard to explore the logs quickly because now all info is nested in a log record, with no hierarchy to preview "just the message" quickly
- Monolog's JSON formatter adds tons of info to the JSON record

Here's an example (Bref Cloud formats the JSON payload FYI, this isn't the case in CloudWatch):

[![Screen-002903](https://private-user-images.githubusercontent.com/720328/455018844-6cdf6498-78d2-4a69-b8e5-83dd02856677.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDE4ODQ0LTZjZGY2NDk4LTc4ZDItNGE2OS1iOGU1LTgzZGQwMjg1NjY3Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwM1QyMjM2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xZTc1ODUzYmVkYjU0YmIxNGExY2Q2MmVjMzk3MzNkN2MxMmZlYTZmMjE0YTZmMjQ0MmNhZDc3YzBmNjc2OWFkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.G70r2v5A1sYsQBHrfgqCI4Gr6K8B2j-DrIwSpFkZN6k)](https://private-user-images.githubusercontent.com/720328/455018844-6cdf6498-78d2-4a69-b8e5-83dd02856677.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDE4ODQ0LTZjZGY2NDk4LTc4ZDItNGE2OS1iOGU1LTgzZGQwMjg1NjY3Ny5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwM1QyMjM2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xZTc1ODUzYmVkYjU0YmIxNGExY2Q2MmVjMzk3MzNkN2MxMmZlYTZmMjE0YTZmMjQ0MmNhZDc3YzBmNjc2OWFkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.G70r2v5A1sYsQBHrfgqCI4Gr6K8B2j-DrIwSpFkZN6k)

CloudWatch has some great features though:

```
This is the log message {"key":"value"}

```

The log message above will automatically get parsed as text (the first part) and a JSON object attached (the second part).

**That means we can have a simple log message + a structured JSON object**.

On top of that, with CloudWatch:

- we don't need to log the timestamp, CloudWatch automatically timestamps log records
- I don't think we need to log the "channel" name: IMO channels make sense to split web logs from jobs or artisan commands, but in Lambda these are separate functions/logs anyway, so I think we can remove that part too

This is why I want to add this `CloudWatchFormatter` optimized for Bref users.

As you can see in the screenshots below, it is easy to navigate the logs textually. But it's also possible to have a lot more information nested in the log records via the JSON object.

In CloudWatch:

[![Screen-002905](https://private-user-images.githubusercontent.com/720328/455026292-721872e6-1c3b-4549-9931-8f597d1f1c7e.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsI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gtQW16LVNpZ25hdHVyZT0xNzhmMzg0OTAwM2I4YzRhZWVmNTI3YTVhZDA4ZDI3YTg1Zjk2MDgyMzAwNzViNGIwZDc5MjAzYjFmOTMyZmZhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.oTNdWH9VVPRuWpuovtld7oNeUIYQX1wpc4aURvMvQRQ)

In Bref Cloud:

[![Screen-002904](https://private-user-images.githubusercontent.com/720328/455025796-4afa6cfd-1b6f-4d04-8233-f1e0a4901fce.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDI1Nzk2LTRhZmE2Y2ZkLTFiNmYtNGQwNC04MjMzLWYxZTBhNDkwMWZjZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwM1QyMjM2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MDBjY2RmMTZkYTA5OGEzZDJjNzc1MzYxMmRmZWFjOGNiMjJiMDJiYTZmOTIxZGU1N2Y2NTQ5M2YwMmVmNzUxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.PCCPOZvb6kKdM1el_4-yc1R5E2dFS4D90de2Q0SsBYI)](https://private-user-images.githubusercontent.com/720328/455025796-4afa6cfd-1b6f-4d04-8233-f1e0a4901fce.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDI1Nzk2LTRhZmE2Y2ZkLTFiNmYtNGQwNC04MjMzLWYxZTBhNDkwMWZjZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwM1QyMjM2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MDBjY2RmMTZkYTA5OGEzZDJjNzc1MzYxMmRmZWFjOGNiMjJiMDJiYTZmOTIxZGU1N2Y2NTQ5M2YwMmVmNzUxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.PCCPOZvb6kKdM1el_4-yc1R5E2dFS4D90de2Q0SsBYI)

In CloudWatch Logs Insights, we can see that keys of the JSON objects are correctly detected:

[![Screen-002906](https://private-user-images.githubusercontent.com/720328/455026951-6a0c011c-667f-4778-b952-cc036e8e46d3.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDI2OTUxLTZhMGMwMTFjLTY2N2YtNDc3OC1iOTUyLWNjMDM2ZThlNDZkMy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNP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uqbj_-o)

That allows us to create advanced queries, for example to search for "ERROR" logs with a specific exception class:

[![Screen-002907](https://private-user-images.githubusercontent.com/720328/455027411-8158a402-0875-499d-a693-62114ab7d07a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDI3NDExLTgxNThhNDAyLTA4NzUtNDk5ZC1hNjkzLTYyMTE0YWI3ZDA3YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwM1QyMjM2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01YzAyNDQ0ZjA0MWQ4ZDlmNjJmZTdlYjVhZTY2NDExZGE0M2RjMjM3NWYyMzNmODhjN2E4OWQxMGYyZjExMDBjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.2wd8R6DMJKyfwn4fW3D0rqP9VdgD7NtoeYEDmJo02kE)](https://private-user-images.githubusercontent.com/720328/455027411-8158a402-0875-499d-a693-62114ab7d07a.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzUyNTYwODEsIm5iZiI6MTc3NTI1NTc4MSwicGF0aCI6Ii83MjAzMjgvNDU1MDI3NDExLTgxNThhNDAyLTA4NzUtNDk5ZC1hNjkzLTYyMTE0YWI3ZDA3YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNDAzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDQwM1QyMjM2MjFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT01YzAyNDQ0ZjA0MWQ4ZDlmNjJmZTdlYjVhZTY2NDExZGE0M2RjMjM3NWYyMzNmODhjN2E4OWQxMGYyZjExMDBjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.2wd8R6DMJKyfwn4fW3D0rqP9VdgD7NtoeYEDmJo02kE)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance52

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity43

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

Every ~0 days

Total

2

Last Release

338d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.1

1.0.1PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/329a6111724074f5388e95dd41a03ccf3c43f4bfe1ecf27c94c9efc6f7823228?d=identicon)[mnapoli](/maintainers/mnapoli)

---

Top Contributors

[![mnapoli](https://avatars.githubusercontent.com/u/720328?v=4)](https://github.com/mnapoli "mnapoli (10 commits)")

---

Tags

awsmonologlambdabrefcloudwatch

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bref-monolog-bridge/health.svg)

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

###  Alternatives

[maxbanton/cwh

AWS CloudWatch Handler for Monolog library

42515.3M27](/packages/maxbanton-cwh)[phpnexus/cwh

AWS CloudWatch Handler for Monolog library

393.2M7](/packages/phpnexus-cwh)[bref/logger

All you need to log with Bref on AWS Lambda

331.5M8](/packages/bref-logger)

PHPackages © 2026

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