PHPackages                             vube/monolog-splunk-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. vube/monolog-splunk-formatter

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

vube/monolog-splunk-formatter
=============================

Splunk Line Formatter for Monolog

1.0.1(10y ago)4468.9k↓21.6%6[2 PRs](https://github.com/vube/monolog-splunk-formatter/pulls)MITPHPPHP &gt;=5.3.0

Since Feb 17Pushed 5y ago4 watchersCompare

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

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

Splunk Formatter
================

[](#splunk-formatter)

[![Build Status](https://camo.githubusercontent.com/469ad1b18d05103cb8e2b1e478fe4fb5a2f376f522480ece3d28ddebdec0fdd1/68747470733a2f2f7472617669732d63692e6f72672f767562652f6d6f6e6f6c6f672d73706c756e6b2d666f726d61747465722e737667)](https://travis-ci.org/vube/monolog-splunk-formatter)[![Coverage Status](https://camo.githubusercontent.com/509c66d262082c4b6aa7e31ee30637cceea13c09503d18e1e1a5f67bbde2e66f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f767562652f6d6f6e6f6c6f672d73706c756e6b2d666f726d61747465722f62616467652e737667)](https://coveralls.io/r/vube/monolog-splunk-formatter)[![Latest Stable Version](https://camo.githubusercontent.com/78c600d82a42bcccc2fe2b7efe3c775c75670b42eb36c3f982965ca905193d80/68747470733a2f2f706f7365722e707567782e6f72672f767562652f6d6f6e6f6c6f672d73706c756e6b2d666f726d61747465722f762f737461626c652e706e67)](https://packagist.org/packages/vube/monolog-splunk-formatter)[![Dependency Status](https://camo.githubusercontent.com/22be74f986189c0662e3c581a24f1a0ae11fd0988652a19a81809b954c58e30b/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3534653264663237386264363966393062643030303037612f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/54e2df278bd69f90bd00007a)

A Splunk Formatter for Monolog

About
-----

[](#about)

`vube/monolog-splunk-formatter` is a formatter for use with [Monolog](https://github.com/Seldaek/monolog). It augments the [Monolog LineFormatter](https://github.com/Seldaek/monolog/blob/master/src/Monolog/Formatter/LineFormatter.php)by adding Splunk-optimized handling of associative array contexts.

Prerequisites/Requirements
--------------------------

[](#prerequisitesrequirements)

- PHP 5.3.0 or greater
- Composer

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

[](#installation)

Installation is possible using Composer

```
composer require vube/monolog-splunk-formatter ~1.0

```

Usage
-----

[](#usage)

Create an instance of `\Vube\Monolog\Formatter\SplunkLineFormatter`and set it as the formatter for the `\Monolog\Handler\StreamHandler`that you use with your `\Monolog\Logger` instance.

```
use \Monolog\Logger;
use \Monolog\Handler\StreamHandler;
use \Vube\Monolog\Formatter\SplunkLineFormatter;

$log = new Logger('DEMO');
$handler = new StreamHandler('php://stdout', Logger::WARNING);
$handler->setFormatter(new SplunkLineFormatter());
$log->pushHandler($handler);

$log->addError('Bad stuff happened', array('detail1' => 'something', 'detail2' => 'otherthing'));

```

Unit Testing
------------

[](#unit-testing)

`vube/monolog-splunk-formatter` ships with unit tests using [PHPUnit](https://github.com/sebastianbergmann/phpunit/).

- If PHPUnit is installed globally run `phpunit` to run the tests.
- If PHPUnit is not installed globally, install it locally through composer by running `composer install --dev`. Run the tests themselves by calling `vendor/bin/phpunit`.

Unit tests are also automatically run [on Travis CI](http://travis-ci.org/vube/monolog-splunk-formatter)

License
-------

[](#license)

`vube/monolog-splunk-formatter` is released under the MIT public license. See the enclosed `LICENSE` for details.

### Thanks

[](#thanks)

Thanks to [Bramus](https://github.com/bramus) for contributing a Monolog formatter, I was inspired by and reused some of his work.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

4014d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e93b948c39aebf57d2f7f3cf4d207e87568ebd9a98cd2dd13356c60a643bf10d?d=identicon)[ross-p](/maintainers/ross-p)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vube-monolog-splunk-formatter/health.svg)

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

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)

PHPackages © 2026

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