PHPackages                             m6web/log-bridge-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. m6web/log-bridge-bundle

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

m6web/log-bridge-bundle
=======================

SF2 Proxy manager Log

v10.2.0(3y ago)18359.5k↓53.8%5[2 issues](https://github.com/BedrockStreaming/LogBridgeBundle/issues)[6 PRs](https://github.com/BedrockStreaming/LogBridgeBundle/pulls)PHPPHP &gt;=8.0CI failing

Since Mar 13Pushed 2y ago44 watchersCompare

[ Source](https://github.com/BedrockStreaming/LogBridgeBundle)[ Packagist](https://packagist.org/packages/m6web/log-bridge-bundle)[ RSS](/packages/m6web-log-bridge-bundle/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (12)Versions (49)Used By (0)

LogBridgeBundle [![Build Status](https://camo.githubusercontent.com/f792ba9ec74d3657f84978786152ded5762f353d78d6bfab793bb7129d790e6f/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e742e7376673f75726c3d6874747073253341253246253246616374696f6e732d62616467652e6174726f782e646576253246426564726f636b53747265616d696e672532464c6f6742726964676542756e646c6525324662616467652533467265662533446d6173746572267374796c653d666c6174)](https://actions-badge.atrox.dev/BedrockStreaming/LogBridgeBundle/goto?ref=master)
=================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#logbridgebundle-)

Symfony Bundle to log Request/Response with Monolog.

**NOTE:** The actual version of this bundle support `Symfony >= 4.4`. If you need support for older versions, please use `~7.0` release.

Features
--------

[](#features)

- semantic configuration
- sf2 event dispatcher integration
- log request filter

Install
-------

[](#install)

**With composer**

```
    "require": {
        "m6web/log-bridge-bundle": "~3.0"
    }

```

**Add to your AppKernel**

```
    $bundles = [
    // ...
        new M6Web\Bundle\LogBridgeBundle\M6WebLogBridgeBundle(),
    //...
    ];

```

Usage
-----

[](#usage)

```
# app/config.yml

m6_web_log_bridge:
    active_filters:
        - get_article_error
        - post_article_all
        - all_error
    filters:
            get_article_error:
                route: get_article
                routes: ['get_article']
                method: ['GET']
                status: [422, 500]
                level: 'error'
                options:
                    response_body: true # from add Response body content (with DefaultFormatter)
            post_article_all:
                route: post_article
                routes: ['post_article']
                method: ~ # from all methods
                status: ~ # from all status
            get_article_not_found:
                route: get_article
                routes: ['get_article']
                method: ['GET']
                status: [404]
                level: 'warning'
            edit_category:
                route: get_category
                routes: ['get_category']
                method: ['POST', 'PUT']
                status: [400-422, ^510, !530-550]
                level: 'error'
                options:
                    post_parameters: true # From add post parameters in response content (with DefaultFormatter)
            all_error: # All route, all method in error
                route: ~
                routes: ~
                method: ~
                status: [31*, 4*, 5*]
                level: 'critical'
    content_formatter: m6web_log_bridge.log_content_formatter # Provider service name
    ignore_headers: # key list from mask/ignore header info
        - php-auth-pw
    prefix_key: ~ # define prefix key on log context
    logger:
        channel: my_channel_to_log # monolog channel, optional, default 'log_bridge'
```

Routes support multiples formats :

```
routes: ['my_route'] # Add only this route
routes: ['my_route', 'another_route'] # Add multiples routes
routes: ['!excluded_one', '!excluded_two'] # Add all routes except the excluded
```

*By default, `level` is `info`*

You can declare all the options you want. By default, only `response_body` and `post_parameters` is supported by the DefaultFormatter

Status support multiples formats :

```
status: [401] # Add status 401
status: [^456] # Add status hundred greater than 450 (456, 457, 458, ..., 499)
status: [4*] # Add status hundred (200, 400, 401, 402, ..., 499)
status: [41*] # Add status decade (410, 411, 412, ..., 419)
status: [425-440] # Add range status (425, 426, 427, ..., 440)
status: [2*, 301, !203-210] # Add status (200, 201, 202, 211, ..., 299, 301)
```

*Instead of add can be use `!` to exclude status*

By default, this bundle use a builtin logger with monolog support `m6web_log_bridge.logger`You can override this configuration by writing your own logger who must implements `Psr\Log\LoggerInterface` :

```
# app/config.yml

m6_web_log_bridge:
    logger:
        service: acme.logger
```

```
services:
    acme.logger:
        class: Acme\DemoBundle\Logger\logger
        arguments: ["@logger"]
        tags:
            - { name: monolog.logger, channel: log_bridge }
```

*`Acme\DemoBundle\Logger\logger` must be implement `Psr\Log\LoggerInterface`*

Define your Provider from format log content
--------------------------------------------

[](#define-your-provider-from-format-log-content)

It is advisable to extend default provider M6Web\\Bundle\\LogBridgeBundle\\Formatter\\DefaultFormatter

**default definition from service provider :**

```
    services:
        m6web_log_bridge.log_content_provider:
            class: '%m6web_log_bridge.log_content_provider.class%'
            arguments:
                - '%kernel.environment%'
                - '%m6web_log_bridge.ignore_headers%'
                - '%m6web_log_bridge.prefix_key%'
            calls:
                - [ setTokenStorage, [ '@security.token_storage' ] ]

```

**From override :**

```
    services:
        acme.my_log_provider:
            class: Acme\Bundle\MyBundle\Provider\LogContentProvider
            parent: m6web_log_bridge.log_content_formatter

```

or simply override this parameter : `m6web_log_bridge.log_content_formatter.class`

### Log contents example

[](#log-contents-example)

```
Request
------------------------
content-type        :
content-length      :
host                : domain.tld
x-real-ip           : *********
x-forwarded-for     : *********
x-forwarded-proto   : http
x-forwarded-port    : 80
remote-user         : u_glinel
connection          : close
cache-control       : max-age=0
authorization       : Basic ************
accept              : text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
user-agent          : Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/127.0.0.1 Chrome/127.0.0.1 Safari/537.36
accept-encoding     : gzip,deflate,sdch
accept-language     : fr-FR,fr;q=0.8,en-US;q=0.6,en;q=0.4
cookie              : PHPSESSID=************
php-auth-user       : u_glinel
x-php-ob-level      : 1
------------------------
Response
------------------------
HTTP 1.0 200
Age:           2
Etag:
Vary:
Cache-Control: no-cache
Content-Type:  application/json
Date:          dd mm yyyy hh:ii:ss GMT
------------------------
Response body
------------------------
Here response content

```

Logging exceptions
------------------

[](#logging-exceptions)

The bundle allow detailed logging of exceptions. This is ensured by the use of `exception.log` in the configuration.

```
# app/config.yml

m6_web_log_bridge:
    exception:
        log: true
        request_attribute: LogBridgeException
```

This switch allows the bundle to register a listener which will save any received exception and passed it within the request under the defined attribute.

If you use the default formatter, change it using the configuration. The bundle provides another formatter implementation able to log exceptions.

```
# app/config.yml

m6_web_log_bridge:
    content_formatter: m6web_log_bridge.log_content_exception_formatter
```

If you prefer to use your own formatter, you will be able to read exceptions directly from the request under the attribute specified in `m6_web_log_bridge.exception.request_attribute`.

Tests
-----

[](#tests)

You can run the unit tests with the following command:

```
    php bin/atoum -d src/M6Web/Bundle/LogBridgeBundle/Tests/Units

```

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community27

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor4

4 contributors hold 50%+ of commits

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

Recently: every ~7 days

Total

47

Last Release

1396d ago

Major Versions

v5.0.0 → v6.0.02018-01-29

v6.0.2 → v7.0.02020-03-24

v7.0.2 → v8.0.02021-06-01

v8.0.1 → v9.0.02021-12-09

v9.0.1 → v10.0.02022-06-13

PHP version history (4 changes)v1.0.1PHP &gt;=5.4

v6.0.0PHP &gt;=5.6

v7.0.0PHP &gt;=7.1.3

v10.0.0PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2069361?v=4)[Patrick](/maintainers/Bedrock)[@Bedrock](https://github.com/Bedrock)

![](https://www.gravatar.com/avatar/4f041a1974dbc19c70e199fb278d9b9026409999444087c7efbd1cb249a49f3a?d=identicon)[omansour](/maintainers/omansour)

---

Top Contributors

[![omansour](https://avatars.githubusercontent.com/u/1131098?v=4)](https://github.com/omansour "omansour (14 commits)")[![jdecool](https://avatars.githubusercontent.com/u/433926?v=4)](https://github.com/jdecool "jdecool (14 commits)")[![maximecolin](https://avatars.githubusercontent.com/u/606766?v=4)](https://github.com/maximecolin "maximecolin (7 commits)")[![lolautruche](https://avatars.githubusercontent.com/u/313528?v=4)](https://github.com/lolautruche "lolautruche (5 commits)")[![valentin-claras](https://avatars.githubusercontent.com/u/4446791?v=4)](https://github.com/valentin-claras "valentin-claras (5 commits)")[![b-viguier](https://avatars.githubusercontent.com/u/5537799?v=4)](https://github.com/b-viguier "b-viguier (4 commits)")[![lnahiro](https://avatars.githubusercontent.com/u/14995154?v=4)](https://github.com/lnahiro "lnahiro (4 commits)")[![Oliboy50](https://avatars.githubusercontent.com/u/2571084?v=4)](https://github.com/Oliboy50 "Oliboy50 (4 commits)")[![mikaelrandy](https://avatars.githubusercontent.com/u/187703?v=4)](https://github.com/mikaelrandy "mikaelrandy (3 commits)")[![embaya](https://avatars.githubusercontent.com/u/10832973?v=4)](https://github.com/embaya "embaya (2 commits)")[![raf262](https://avatars.githubusercontent.com/u/24521850?v=4)](https://github.com/raf262 "raf262 (2 commits)")[![Fabex](https://avatars.githubusercontent.com/u/1540419?v=4)](https://github.com/Fabex "Fabex (1 commits)")[![pgrimaud](https://avatars.githubusercontent.com/u/1866496?v=4)](https://github.com/pgrimaud "pgrimaud (1 commits)")[![mojoLyon](https://avatars.githubusercontent.com/u/797786?v=4)](https://github.com/mojoLyon "mojoLyon (1 commits)")[![shavounet](https://avatars.githubusercontent.com/u/2323369?v=4)](https://github.com/shavounet "shavounet (1 commits)")[![Shoormax](https://avatars.githubusercontent.com/u/22323027?v=4)](https://github.com/Shoormax "Shoormax (1 commits)")[![Stax](https://avatars.githubusercontent.com/u/1269657?v=4)](https://github.com/Stax "Stax (1 commits)")[![noodle69](https://avatars.githubusercontent.com/u/6176289?v=4)](https://github.com/noodle69 "noodle69 (1 commits)")

###  Code Quality

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/m6web-log-bridge-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/m6web-log-bridge-bundle/health.svg)](https://phpackages.com/packages/m6web-log-bridge-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M737](/packages/sylius-sylius)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k61](/packages/open-dxp-opendxp)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M203](/packages/sulu-sulu)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.1k17.8k](/packages/prestashop-prestashop)

PHPackages © 2026

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