PHPackages                             thinkfluent/runphp-monolog-formatter - 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. thinkfluent/runphp-monolog-formatter

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

thinkfluent/runphp-monolog-formatter
====================================

Monolog JSON formatter for runphp / Google Cloud Run Toolkit

v2.0.0(7mo ago)01.0kMITPHP

Since Nov 23Pushed 7mo agoCompare

[ Source](https://github.com/thinkfluent/runphp-monolog-formatter)[ Packagist](https://packagist.org/packages/thinkfluent/runphp-monolog-formatter)[ RSS](/packages/thinkfluent-runphp-monolog-formatter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (9)Used By (0)

Monolog JSON Formatter for Google Cloud Run
===========================================

[](#monolog-json-formatter-for-google-cloud-run)

This produces correctly formatted JSON log messages that are automatically parsed by Google Cloud Logging.

Designed to work with RunPHP Serverless Toolkit, but can also run standalone.

Advantages
----------

[](#advantages)

Ensures the current "trace context" is applied to log entries - meaning **logs can be grouped by request** in the Google Cloud Logging console.

Install with Composer
---------------------

[](#install-with-composer)

```
composer require thinkfluent/runphp-monolog-formatter
```

### Monolog Version Compatibility

[](#monolog-version-compatibility)

Monolog has changes in v3.x that are not backwards compatible with v2.x.

- For Monolog 1 or 2, use version `^1.0` of this package.
- For Monolog 3, use version `^2.0` of this package.

Example Usage
-------------

[](#example-usage)

```
use \Monolog\Level;
use \Monolog\Logger;
use \Monolog\Handler\StreamHandler;
use \ThinkFluent\RunPHP\Logging\StackdriverJsonFormatter;

$handler = new StreamHandler('php://stderr', Level::Info);
StackdriverJsonFormatter::applyInGoogleCloudContext($handler);
$logger = new Logger('my-log');
$logger->pushHandler($handler);
```

In this sample we use `applyInGoogleCloudContext()` to only apply the JSON formatter when running in Google Cloud.

Locally, this will log a more human-readable format.

*Please Note* the auto-detection of GCP relies on code in from . If you're using this formatter outside of RunPHP images, you'll have to implement your own detection.

###  Health Score

38

—

LowBetter than 84% of packages

Maintenance66

Regular maintenance activity

Popularity18

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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 ~205 days

Recently: every ~223 days

Total

6

Last Release

235d ago

Major Versions

v1.1.1 → v2.0.02025-09-15

### Community

Maintainers

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

---

Top Contributors

[![tomwalder](https://avatars.githubusercontent.com/u/1258131?v=4)](https://github.com/tomwalder "tomwalder (17 commits)")

---

Tags

logloggingmonologstackdrivercloud rungoogle cloud run

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/thinkfluent-runphp-monolog-formatter/health.svg)

```
[![Health](https://phpackages.com/badges/thinkfluent-runphp-monolog-formatter/health.svg)](https://phpackages.com/packages/thinkfluent-runphp-monolog-formatter)
```

###  Alternatives

[inpsyde/wonolog

Monolog-based logging package for WordPress.

183617.9k6](/packages/inpsyde-wonolog)[codeinternetapplications/monolog-stackdriver

Stackdriver handler for Monolog.

14181.7k](/packages/codeinternetapplications-monolog-stackdriver)[logtail/monolog-logtail

Logtail handler for Monolog

233.2M3](/packages/logtail-monolog-logtail)[inpsyde/logzio-monolog

Logz.io integration for Monolog

191.2M1](/packages/inpsyde-logzio-monolog)[mero/yii2-monolog

The Monolog integration for the Yii framework.

42186.1k](/packages/mero-yii2-monolog)[mero/telegram-handler

Monolog handler to send log by Telegram

36113.3k](/packages/mero-telegram-handler)

PHPackages © 2026

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