PHPackages                             hannesvdvreken/guzzle-debugbar - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. hannesvdvreken/guzzle-debugbar

ActiveLibrary[HTTP &amp; Networking](/categories/http)

hannesvdvreken/guzzle-debugbar
==============================

A Guzzle middleware that logs requests to debugbar's timeline

4.0.1(1y ago)76410.4k—6.4%13[1 issues](https://github.com/hannesvdvreken/guzzle-debugbar/issues)1MITPHPPHP &gt;=7.2

Since Nov 10Pushed 1y ago2 watchersCompare

[ Source](https://github.com/hannesvdvreken/guzzle-debugbar)[ Packagist](https://packagist.org/packages/hannesvdvreken/guzzle-debugbar)[ GitHub Sponsors](https://github.com/sponsors/barryvdh)[ GitHub Sponsors](https://github.com/sponsors/hannesvdvreken)[ RSS](/packages/hannesvdvreken-guzzle-debugbar/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (12)Used By (1)

[Guzzle](http://docs.guzzlephp.org/en/latest/) middleware to log requests to [PHP DebugBar](https://github.com/maximebf/php-debugbar)'s timeline
================================================================================================================================================

[](#guzzle-middleware-to-log-requests-to-php-debugbars-timeline)

⚠️ This project is up for adoption. Get in touch if you're interested in actively maintaining 3 closely related packages.

[![Build Status](https://camo.githubusercontent.com/963a8c459d653fe6d4e992671d830464da125330cf5e096842e8c6789cebfbfd/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f68616e6e657376647672656b656e2f67757a7a6c652d64656275676261722f332e783f7374796c653d666c61742d737175617265)](https://travis-ci.org/hannesvdvreken/guzzle-debugbar)[![Latest Stable Version](https://camo.githubusercontent.com/02a9cccd8c6a86ec4c6c43377c625191ddccaf44743514b7ace5e7cfe50168df/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68616e6e657376647672656b656e2f67757a7a6c652d64656275676261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hannesvdvreken/guzzle-debugbar)[![Code Quality](https://camo.githubusercontent.com/016f880b17595916108f92d5fdffefb8490fc018abf76ad86fba72778b9c7d9c/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f68616e6e657376647672656b656e2f67757a7a6c652d64656275676261722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/hannesvdvreken/guzzle-debugbar/)[![Code Coverage](https://camo.githubusercontent.com/1478ef5661bf70cdd8bf364e433d2a9c712639a66871f32d59d93ed813de4f67/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f68616e6e657376647672656b656e2f67757a7a6c652d64656275676261722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/hannesvdvreken/guzzle-debugbar/)[![Total Downloads](https://camo.githubusercontent.com/2a394d78fde200dc2d589c9c0b932ed7aa28a8b14f40009162cb9e9a8233633d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68616e6e657376647672656b656e2f67757a7a6c652d64656275676261722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hannesvdvreken/guzzle-debugbar)[![License](https://camo.githubusercontent.com/93e60d238a350fd8733c33cfac42583f9f96a7806bd5f70d0fd0d3a5dd0c5691/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f68616e6e657376647672656b656e2f67757a7a6c652d64656275676261723f7374796c653d666c61742d737175617265)](#license)

Guzzle middleware to log requests to DebugBar's timeline.

[![Debugbar timeline](images/debugbar-timeline.png)](images/debugbar-timeline.png)[![Debugbar logs](images/debugbar-logs.png)](images/debugbar-logs.png)

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

[](#installation)

```
composer require hannesvdvreken/guzzle-debugbar --dev

```

Usage
-----

[](#usage)

Just six lines of code are needed to log your requests to DebugBar's timeline.

```
$debugBar = new StandardDebugBar();
// or when using Laravel:
$debugBar = app('debugbar');

// Get data collector.
$timeline = $debugBar->getCollector('time');

// Wrap the timeline.
$profiler = new \GuzzleHttp\Profiling\Debugbar\Profiler($timeline);

// Add the middleware to the stack
$stack = \GuzzleHttp\HandlerStack::create();
$stack->unshift(new \GuzzleHttp\Profiling\Middleware($profiler));

// New up the client with this handler stack.
$client = new \GuzzleHttp\Client(['handler' => $stack]);
```

Now `$client` is ready to make requests. Every request is now logged to the timeline.

### Recommended: use Guzzle's Log middleware

[](#recommended-use-guzzles-log-middleware)

```
$debugBar = new StandardDebugBar();
// or when using Laravel:
$debugBar = app('debugbar');

// PSR-3 logger:
$logger = $debugBar->getCollector('messages');

// Create a new Log middleware.
$stack->push(\GuzzleHttp\Middleware::log($logger, new \GuzzleHttp\MessageFormatter()));

// New up the client with this handler stack.
$client = new \GuzzleHttp\Client(['handler' => $stack]);
```

Support
-------

[](#support)

### Laravel

[](#laravel)

It is recommended to have my friend Barry's [laravel-debugbar](https://github.com/barryvdh/laravel-debugbar) installed and configured. Make sure to include his and our service providers your app's `providers` array:

```
'providers' => [
    ...
    Barryvdh\Debugbar\ServiceProvider::class,
    GuzzleHttp\Profiling\Debugbar\Support\Laravel\ServiceProvider::class,
],
```

If you want to use a different `DebugBar\DebugBar` instance, create a ServiceProvider that binds an instance with the key `debugbar`. For example with this register method:

```
public function register()
{
    $this->app->singleton('debugbar', function () {
        return new \DebugBar\StandardDebugBar();
    });
}
```

Be sure to create every client (type hint with `GuzzleHttp\ClientInterface` or `GuzzleHttp\Client`) via the IoC container.

### FAQ:

[](#faq)

I get one of these errors:

`'time' is not a registered collector``'exceptions' is not a registered collector`

It means you disabled the `time` collector and/or the `exceptions` collector in your `packages/barryvdh/laravel-debugbar/config.php`. These are enabled by default. This package depends on it, so please enable them both.

Contributing
------------

[](#contributing)

Feel free to make a pull request. Please try to be as [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)compliant as possible. Fix Code Style quickly by running `vendor/bin/php-cs-fixer fix`. Give a good description of what is supposed to be added/changed/removed/fixed.

### Testing

[](#testing)

To test your code before pushing, run the unit test suite.

```
vendor/bin/phpunit
```

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance44

Moderate activity, may be stable

Popularity50

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% 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 ~342 days

Recently: every ~406 days

Total

12

Last Release

444d ago

Major Versions

1.x-dev → 2.0.02015-11-25

2.x-dev → 3.0.02020-07-18

3.x-dev → 4.0.02025-02-28

PHP version history (2 changes)2.0.0PHP &gt;=5.5.0

3.0.0PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1410358?v=4)[Hannes Van De Vreken](/maintainers/hannesvdvreken)[@hannesvdvreken](https://github.com/hannesvdvreken)

---

Top Contributors

[![hannesvdvreken](https://avatars.githubusercontent.com/u/1410358?v=4)](https://github.com/hannesvdvreken "hannesvdvreken (51 commits)")[![JaZo](https://avatars.githubusercontent.com/u/3475007?v=4)](https://github.com/JaZo "JaZo (2 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (1 commits)")[![jadonbrownza](https://avatars.githubusercontent.com/u/7773361?v=4)](https://github.com/jadonbrownza "jadonbrownza (1 commits)")[![michielgerritsen](https://avatars.githubusercontent.com/u/5858697?v=4)](https://github.com/michielgerritsen "michielgerritsen (1 commits)")[![ockle](https://avatars.githubusercontent.com/u/2755069?v=4)](https://github.com/ockle "ockle (1 commits)")

---

Tags

httplogphpmiddlewareprofilerdebugbarGuzzleprofiling

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/hannesvdvreken-guzzle-debugbar/health.svg)

```
[![Health](https://phpackages.com/badges/hannesvdvreken-guzzle-debugbar/health.svg)](https://phpackages.com/packages/hannesvdvreken-guzzle-debugbar)
```

###  Alternatives

[kevinrob/guzzle-cache-middleware

A HTTP/1.1 Cache for Guzzle 6. It's a simple Middleware to be added in the HandlerStack. (RFC 7234)

43417.4M104](/packages/kevinrob-guzzle-cache-middleware)[hannesvdvreken/guzzle-clockwork

A Guzzle middleware that logs requests with Clockwork

4557.7k](/packages/hannesvdvreken-guzzle-clockwork)[rtheunissen/guzzle-log-middleware

Guzzle middleware to log requests and responses

842.3M17](/packages/rtheunissen-guzzle-log-middleware)[eljam/guzzle-jwt-middleware

A jwt authentication middleware for guzzle 6

28722.5k3](/packages/eljam-guzzle-jwt-middleware)[rtheunissen/guzzle-rate-limiter

Guzzle 6 middleware used to delay requests dynamically

52177.2k1](/packages/rtheunissen-guzzle-rate-limiter)[middlewares/debugbar

Middleware to insert PHP DebugBar automatically in html responses

1822.1k7](/packages/middlewares-debugbar)

PHPackages © 2026

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