PHPackages                             silpion/logger-extra-bundle - 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. silpion/logger-extra-bundle

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

silpion/logger-extra-bundle
===========================

Extra logging features for Monolog in a Symfony2 bundle.

0.1.0-beta1(11y ago)43.3k[4 issues](https://github.com/h4cc/LoggerExtraBundle/issues)MITPHP

Since Mar 8Pushed 11y ago3 watchersCompare

[ Source](https://github.com/h4cc/LoggerExtraBundle)[ Packagist](https://packagist.org/packages/silpion/logger-extra-bundle)[ Docs](https://github.com/h4cc/LoggerExtraBundle/)[ RSS](/packages/silpion-logger-extra-bundle/feed)WikiDiscussions master Synced 2mo ago

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

LoggerExtraBundle
=================

[](#loggerextrabundle)

[![Build Status](https://camo.githubusercontent.com/0956b6a57449c92fbc32b9170f0afc4c207c9592fc38f86ad060e64ec071ad6e/68747470733a2f2f7472617669732d63692e6f72672f683463632f4c6f67676572457874726142756e646c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/h4cc/LoggerExtraBundle)[![Latest Stable Version](https://camo.githubusercontent.com/32fa6f30ebdc2e9a1e50a26277d423a058873384ab14abc2f30dbb861a0aef17/68747470733a2f2f706f7365722e707567782e6f72672f73696c70696f6e2f6c6f676765722d65787472612d62756e646c652f762f737461626c652e706e67)](https://packagist.org/packages/silpion/logger-extra-bundle)[![License](https://camo.githubusercontent.com/3c24480e20b3aa05239da869f27a0ecf4f88267731cc38e288113ffa13e70764/68747470733a2f2f706f7365722e707567782e6f72672f73696c70696f6e2f6c6f676765722d65787472612d62756e646c652f6c6963656e73652e706e67)](https://packagist.org/packages/silpion/logger-extra-bundle)[![Scrutinizer Quality Score](https://camo.githubusercontent.com/cfd464f209792b91c3626a0b676becaf0127c0e7a48025eb84307ecc9d205b37/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f683463632f4c6f67676572457874726142756e646c652f6261646765732f7175616c6974792d73636f72652e706e673f733d62373264343764393730656663313864336264613766613863616662353035373266303735643737)](https://scrutinizer-ci.com/g/h4cc/LoggerExtraBundle/)[![Code Coverage](https://camo.githubusercontent.com/a10af7a56ebc7a4ff7cc3ad6ceac9d310c794baeca017c6f3b29ef960dcccc0b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f683463632f4c6f67676572457874726142756e646c652f6261646765732f636f7665726167652e706e673f733d65343438316235336635346638356237363866636335663863636531373066353365366661663330)](https://scrutinizer-ci.com/g/h4cc/LoggerExtraBundle/)[![HHVM Status](https://camo.githubusercontent.com/5a32ada3f41ed0cfbda734084c3066bcd3f50da7f9515c6d777d0289b3f0273c/687474703a2f2f6868766d2e683463632e64652f62616467652f73696c70696f6e2f6c6f676765722d65787472612d62756e646c652e706e67)](http://hhvm.h4cc.de/package/silpion/logger-extra-bundle)[![Dependency Status](https://camo.githubusercontent.com/d408227ff6867a7d7e9f300731cb6a90d330ea3776cc4cff8ad12249df889b8a/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f73696c70696f6e3a6c6f676765722d65787472612d62756e646c652f6465762d6d61737465722f62616467652e706e67)](https://www.versioneye.com/php/silpion:logger-extra-bundle/dev-master)[![Project Status](https://camo.githubusercontent.com/57425e4e2f5b8d37f17d9af812cae8962a31618d07cfe2981f9700bbe1e17490/687474703a2f2f7374696c6c6d61696e7461696e65642e636f6d2f683463632f4c6f67676572457874726142756e646c652e706e67)](http://stillmaintained.com/h4cc/LoggerExtraBundle)

Symfony2 Bundle for Logging related functionality. This bundle can give you these features:

- Add a unique RequestId to each message of the current request.
- Add a unique SessionId to each message dependent on current session id.
- Add arbitrary "key: value" pairs to each message of the current request.
- Create a log entry on a MASTER Request.
- Create a log entry on a Response.

There is also a Stack Middleware for logging Requests and Responses: [silpion/stack-logger](https://github.com/h4cc/StackLogger)

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

[](#installation)

Using Composer:

```
php composer.phar require silpion/logger-extra-bundle

```

Also add SilpionLoggerExtraBundle to your AppKernel:

```
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new Silpion\LoggerExtraBundle\SilpionLoggerExtraBundle(),
        );
        ...
    }
}

```

Configuration
-------------

[](#configuration)

By default, this bundle will not do anything! Every feature has to be enabled on its own.

Example configuration:

```
silpion_logger_extra:

    # If a random request_id should be added to the [extra] section of each log message.
    request_id:           true

    # Class of the used request_id provider.
    request_id_provider:  Silpion\LoggerExtraBundle\Logger\Provider\Request\UniqRequestIdProvider

    # If a salted SHA1 of the session_id should be added to the [extra] section of each log message.
    session_id:           true

    # Class of the used session_id provider.
    session_id_provider:  Silpion\LoggerExtraBundle\Logger\Provider\Session\SymfonySessionIdProvider

    # If the current PID of the PHP Interpreter should be added to the [extra] section of each log message.
    process_id:           true

    # If the session should be started, so the session_id will always be available.
    session_start:        false

    # A list of "key: value" entries that will be set in the [extra] section of each log message (Overwrites existing keys!).
    additions:
        server_id: 42

    logger:

        # Will create a log entry on each incoming request.
        on_request:           true

        # Will create a log entry on each outgoing response.
        on_response:          true

```

Available Providers
-------------------

[](#available-providers)

### RequestIdProvider

[](#requestidprovider)

Next to the `UniqRequestIdProvider`, which will generate a simple sha1 hash, there is also the `EnrichedRequestIdProvider` that will generate MongoDb ObjectId like hashes containing the current timestamp, machineId, processId. The `EnrichedRequestIdProvider` will generate request\_id, that will be sortable by creation time.

Usage
-----

[](#usage)

If you want to use the current RequestId or SessionId somewhere in your application, see this code:

```
$requestId = $this->get('silpion_logger_extra')->getRequestId();
$sessionId = $this->get('silpion_logger_extra')->getSessionId();

```

References
----------

[](#references)

Funny enough a example for adding a RequestId is in a [Symfony2 Cookbook](http://symfony.com/doc/current/cookbook/logging/monolog.html#adding-some-extra-data-in-the-log-messages), but not available in a bundle till now.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Total

2

Last Release

4242d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ce109f0fc05421b5db21c1f35e9ff78be9bae38f5b6e3bd6121f2eb2417cf53?d=identicon)[h4cc](/maintainers/h4cc)

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

---

Top Contributors

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

---

Tags

bundleloggingextraSymfony2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/silpion-logger-extra-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/silpion-logger-extra-bundle/health.svg)](https://phpackages.com/packages/silpion-logger-extra-bundle)
```

###  Alternatives

[marvinlabs/laravel-discord-logger

Logging to a discord channel in Laravel

2081.1M2](/packages/marvinlabs-laravel-discord-logger)[bugsnag/bugsnag-symfony

Official BugSnag notifier for Symfony applications.

453.0M3](/packages/bugsnag-bugsnag-symfony)[evolution7/bugsnag-bundle

Bugsnag error reporting integration for Symfony2

19126.5k1](/packages/evolution7-bugsnag-bundle)[friendsofopentelemetry/opentelemetry-bundle

Traces, metrics, and logs instrumentation within your Symfony application

638.6k](/packages/friendsofopentelemetry-opentelemetry-bundle)[muhammadsadeeq/laravel-activitylog-ui

A beautiful, modern UI for Spatie's Activity Log with advanced filtering, analytics, and real-time features.

17510.1k](/packages/muhammadsadeeq-laravel-activitylog-ui)

PHPackages © 2026

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