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

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

etsglobal/log-bundle
====================

v5.1.0(1y ago)031.7k↓65.6%MITPHPPHP ^8.4CI failing

Since Jul 23Pushed 3mo ago14 watchersCompare

[ Source](https://github.com/ETSGlobal/LogBundle)[ Packagist](https://packagist.org/packages/etsglobal/log-bundle)[ RSS](/packages/etsglobal-log-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (9)Versions (30)Used By (0)

LogBundle
=========

[](#logbundle)

Provides normalized logging and tracing features for all ETSGlobal Symfony applications.

[![Build Status](https://camo.githubusercontent.com/9a9516e38b3c89dd7b9d60f17dd873840bcb4559b6a6980d1888f703928abde5/68747470733a2f2f7472617669732d63692e6f72672f455453476c6f62616c2f4c6f6742756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ETSGlobal/LogBundle)

Overview
--------

[](#overview)

Main features:

- Automatic logger injection.
- Provide `TokenCollection` utility to enable downstream applications for request tracing from app to app.
- Automatically configure `global` and `process` token tracing for incoming HTTP requests/responses as well as long-running processes.
- Automatically enrich log context with the application name and tracing tokens.
- Processor to change the log level of exceptions, like Symfony's `NotFoundHttpException`
- Slack handler: An extended version of Monolog's slack handler, with custom message contents, and custom filters.
- Provides a Guzzle middleware to forward tokens through HTTP calls.
- Provides a Symfony HttpClient decorator to forward tokens through HTTP calls.

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

[](#installation)

1. Install the bundle

```
composer require etsglobal/log-bundle
```

2. Load the bundle

```
// config/Bundles.php
return [
    ...
    ETSGlobal\LogBundle\ETSGlobalLogBundle::class => ['all' => true],
    ...
];
```

For Symfony &lt; 4

```
// app/AppKernel.php
$bundles = [
    ...
    new ETSGlobal\LogBundle\ETSGlobalLogBundle(),
    ...
];
```

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

[](#configuration)

### Bundle configuration

[](#bundle-configuration)

```
# config/packages/ets_global_log.yaml
ets_global_log:
    app_name: my-app # Used to filter logs by application.
    slack_handler:
        token: "slack API token"
        channel: "#channel-name"
        jira_url: "example.jira.com"
        kibana_url: "kibana.example.com/app/kibana"
    custom_exceptions_levels:
        My\Custom\Exception: !php/const Monolog\Logger::INFO
```

### Monolog configuration

[](#monolog-configuration)

If you want to use the slack handler provided by this bundle, add the following configuration:

```
# config/packages//monolog.yaml
monolog:
    handlers:
        ...
        slack_failure:
            type: 'whatfailuregroup'
            members: ['slack']
        slack:
            type: 'service'
            id:  'ets_global_log.monolog.handler.slack'
            level: "error"
```

If you have a file handler, you might want to use the token\_collection formatter to add the tracing tokens:

```
# config/packages//monolog.yaml
monolog:
    handlers:
        ...
        file:
            type: "rotating_file"
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
            formatter: 'ets_global_log.monolog.formatter.token_collection'
```

### Automatic logger injection

[](#automatic-logger-injection)

Automatic logger injection will try to inject the logger in all services tagged with the `ets_global_log.logger_aware` tag. The services hate to implement `Psr\Log\LoggerAwareInterface` to receive the logger by setter injection.

```
// src/MyService.php
namespace App;

use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerAwareTrait;

class MyService implements LoggerAwareInterface
{
    use LoggerAwareTrait;
}
```

```
# config/services.yaml
App\MyService:
    tags:
    - { name: "ets_global_log.logger_aware" }
```

### Symfony HttpClient decorator

[](#symfony-httpclient-decorator)

Install `symfony/http-client`:

```
composer require symfony/http-client
```

Configure your scoped client:

```
framework:
    http_client:
        scoped_clients:
            my.client:
                base_uri: 'example.com/api/'
```

Just inject the `my.client` HttpClient in your services like normally. The `HttpClientDecorator` will decorate the HttpClient to automatically inject the `token_global` in the request.

### Guzzle middleware

[](#guzzle-middleware)

Install `csa/guzzle-bundle`:

```
composer require csa/guzzle-bundle
```

Configure HTTP clients with the "token\_global" middleware:

```
# config/packages/cas_guzzle.yaml
csa_guzzle:
     profiler: '%kernel.debug%'
     logger: true
     clients:
         foo:
             config:
                 base_uri: "http://example.com/api"
             middleware: ['token_global']
```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance61

Regular maintenance activity

Popularity25

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity87

Battle-tested with a long release history

 Bus Factor2

2 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 ~101 days

Recently: every ~127 days

Total

25

Last Release

105d ago

Major Versions

v1.5.1 → v2.0.02022-01-04

v2.0.0 → v3.0.02022-03-21

v3.0.1 → v4.0.02022-08-26

v4.0.1 → v5.0.02023-12-15

v1.5.2 → v5.0.32024-10-28

PHP version history (8 changes)v0.1.0PHP ^7.2

v1.3.0PHP ^7.2 || ^8.0

v1.4.0PHP ^7.4 || ^8.0

v2.0.0PHP ^8.0

v3.0.0PHP ^8.1

v5.0.0PHP ^8.3

v5.0.3PHP ^8.3 || ^8.4

v5.1.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b0b8e0ec7f4f84efcc044b598742033414f3a05e5a0097034794ebce3e02c26?d=identicon)[ETSGlobal](/maintainers/ETSGlobal)

![](https://avatars.githubusercontent.com/u/4977244?v=4)[Robin Graillon](/maintainers/graillus)[@graillus](https://github.com/graillus)

---

Top Contributors

[![graillus](https://avatars.githubusercontent.com/u/4977244?v=4)](https://github.com/graillus "graillus (42 commits)")[![aallier](https://avatars.githubusercontent.com/u/28858326?v=4)](https://github.com/aallier "aallier (27 commits)")[![lepiaf](https://avatars.githubusercontent.com/u/1940947?v=4)](https://github.com/lepiaf "lepiaf (7 commits)")[![AndreiScheau](https://avatars.githubusercontent.com/u/6423639?v=4)](https://github.com/AndreiScheau "AndreiScheau (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![vaneavasco](https://avatars.githubusercontent.com/u/2719705?v=4)](https://github.com/vaneavasco "vaneavasco (3 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![loverg-c](https://avatars.githubusercontent.com/u/4719382?v=4)](https://github.com/loverg-c "loverg-c (2 commits)")[![xunleii](https://avatars.githubusercontent.com/u/19666897?v=4)](https://github.com/xunleii "xunleii (2 commits)")

---

Tags

symfony-bundle

### Embed Badge

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

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

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[chameleon-system/chameleon-base

The Chameleon System core.

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

PHPackages © 2026

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