PHPackages                             netflie/monolog-stackdriver-handler - 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. netflie/monolog-stackdriver-handler

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

netflie/monolog-stackdriver-handler
===================================

A Google Stackdriver logging handler for Monolog.

v0.0.1(6y ago)147.6k↓26.1%1MITPHPPHP &gt;=7.0.0

Since Nov 5Pushed 6y ago1 watchersCompare

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

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

MonologStackdriverHandler
=========================

[](#monologstackdriverhandler)

This package allows you to store Monolog log data to Google Cloud Platform (Google Stackdriver Logging service).

This package also allows you enabling batching option to batch multiple logs into one single RPC call.

### Installation

[](#installation)

To begin, install the preferred dependency manager for PHP, Composer.

Now to install just this component:

```
$ composer require netflie/monolog-stackdriver-handler

```

### Configuration

[](#configuration)

```
require 'vendor/autoload.php';

use Netflie\MonologStackdriverHandler\MonologStackdriverHandler;
use Monolog\Logger;

// See Google\Cloud\Logging\LoggingClient::__construct
$loggingClientOptions = [
    'keyFilePath' => '/path/to/service-account-key-file.json'
];

$monologStackdriverHandler = new MonologStackdriverHandler('my_log', $loggingClientOptions);

$monologLogger = new Logger('name');
$monologLogger->pushHandler($monologStackdriverHandler);

// Send records to Google Stackdriver Logging
$monologLogger->notice('Foo');
$monologLogger->error('Bar');
```

### Enabling batching option

[](#enabling-batching-option)

The handler sends the logs synchronously. This means that whenever you emit a log, it will add RPC latency to the user request. Especially if you emit multiple logs in a single request, the added latency will be significant. You probably want to avoid that.

The following code creates a PSR-3 handler logger which will batch multiple logs into one single RPC calls:

```
$loggerOptions = [
    'batchEnabled' => true,
];

$monologStackdriverHandler = new MonologStackdriverHandler(
    'my_log',
    $loggingClientOptions,
    $loggerOptions
);
```

### Version

[](#version)

This component will not introduce backwards-incompatible changes in any minor or patch releases. We will address issues and requests with the highest priority.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity42

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

2386d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88d39d191e6322bc615ef8db2ccd459a4d40d0eddd94e20b43469e69e549fcde?d=identicon)[netflie](/maintainers/netflie)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/netflie-monolog-stackdriver-handler/health.svg)

```
[![Health](https://phpackages.com/badges/netflie-monolog-stackdriver-handler/health.svg)](https://phpackages.com/packages/netflie-monolog-stackdriver-handler)
```

###  Alternatives

[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k189.7M258](/packages/symfony-monolog-bridge)[rollbar/rollbar

Monitors errors and exceptions and reports them to Rollbar

33723.7M82](/packages/rollbar-rollbar)[illuminate/log

The Illuminate Log package.

6224.3M518](/packages/illuminate-log)[honeybadger-io/honeybadger-php

Honeybadger PHP library

381.5M4](/packages/honeybadger-io-honeybadger-php)[graycore/magento2-stdlogging

A Magento 2 module that changes all logging handlers to stdout

2382.6k](/packages/graycore-magento2-stdlogging)

PHPackages © 2026

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