PHPackages                             hannesvdvreken/guzzle-clockwork - 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-clockwork

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

hannesvdvreken/guzzle-clockwork
===============================

A Guzzle middleware that logs requests with Clockwork

3.0.0(5y ago)4557.7k↓33.3%9MITPHPPHP &gt;=7.2

Since Jan 20Pushed 2y ago1 watchersCompare

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

READMEChangelog (7)Dependencies (5)Versions (19)Used By (0)

[Guzzle](http://docs.guzzlephp.org/en/latest/) middleware for [Clockwork](https://github.com/itsgoingd/clockwork) logging
=========================================================================================================================

[](#guzzle-middleware-for-clockwork-logging)

⚠️ 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/3ec90e63b0132a24d3d50f1459a48646c51745bb2b9b5fb014096a6d11d6888b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f68616e6e657376647672656b656e2f67757a7a6c652d636c6f636b776f726b2f332e783f7374796c653d666c61742d737175617265)](https://travis-ci.org/hannesvdvreken/guzzle-clockwork)[![Latest Stable Version](https://camo.githubusercontent.com/b5ffe473653c30057d812e62335930c86b2dec22ca4790eddbc4408b722217b1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68616e6e657376647672656b656e2f67757a7a6c652d636c6f636b776f726b3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hannesvdvreken/guzzle-clockwork)[![Code Quality](https://camo.githubusercontent.com/5b8f48aee3f329ff8abb719b04c26bfd7f419baa41da22fb385954aa72eed2ca/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f68616e6e657376647672656b656e2f67757a7a6c652d636c6f636b776f726b3f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/hannesvdvreken/guzzle-clockwork/)[![Code Coverage](https://camo.githubusercontent.com/3aa76cd9a02f5b4be8c4fc278241e878cf6f9be81f268e05bac8e2000dfa4f8e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f68616e6e657376647672656b656e2f67757a7a6c652d636c6f636b776f726b3f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/hannesvdvreken/guzzle-clockwork/)[![Total Downloads](https://camo.githubusercontent.com/ee65a4dc6b63ef581bd3b1402a568b460232cb2d09ca168398401bb3348d40ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68616e6e657376647672656b656e2f67757a7a6c652d636c6f636b776f726b3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/hannesvdvreken/guzzle-clockwork)[![License](https://camo.githubusercontent.com/2c9aa967efbf041c996a85dc6bc0143493fed5e7657bfab8ad291f5eb62874f7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f68616e6e657376647672656b656e2f67757a7a6c652d636c6f636b776f726b3f7374796c653d666c61742d737175617265)](#license)

Guzzle middleware for logging requests clockwork's timeline so you can view the timeline in your browser's developer tools.

[![Developer tools timeline](images/clockwork-timeline.png "Developer tools timeline")](images/clockwork-timeline.png)

[![Developer tools logs](images/clockwork-logs.png "Developer tools logs")](images/clockwork-logs.png)

Usage
-----

[](#usage)

```
// First you need a Clockwork object
$clockwork = \Clockwork\Support\Vanilla\Clockwork::init();

// Create the Guzzle middleware
$middleware = new \GuzzleHttp\Profiling\Middleware(
    new \GuzzleHttp\Profiling\Clockwork\Profiler($clockwork->getClockwork()->timeline())
);

// Then you need to add it to the Guzzle HandlerStack
$stack = \GuzzleHttp\HandlerStack::create();

$stack->unshift($middleware);

$client = new \GuzzleHttp\Client(['handler' => $stack]);

$client->get('https://httpbin.org/status/418');
```

Depending on your integration of Clockwork, make sure that you call `$clockwork->requestProcessed();` before you output your page.

### Laravel

[](#laravel)

If you are using Laravel, use the included service providers to add the subscriber to every Guzzle Client.

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

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

Guzzle v4 and v5
----------------

[](#guzzle-v4-and-v5)

Versions `0.2.0` and up until `1.0.0` (exclusively) are all compatible with Guzzle v4 and v5. To develop for these versions of Guzzle, use the `guzzle4-5` [branch](https://github.com/hannesvdvreken/guzzle-clockwork/tree/guzzle4-5).

Use

Guzzle v3
---------

[](#guzzle-v3)

If you want to continue to work with the old Guzzle v3 (`Guzzle\Http\Client` instead of `GuzzleHttp\Client`) ClockworkPlugin then you might want to install the `0.1.*` releases. Pull request with Guzzle v3 compatibility should be made against the `guzzle3` [branch](https://github.com/hannesvdvreken/guzzle-clockwork/tree/guzzle3). Install the latest guzzle v3 compatible version with `0.1.*` or `dev-guzzle3`.

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

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity40

Moderate usage in the ecosystem

Community16

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% 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 ~228 days

Recently: every ~329 days

Total

17

Last Release

838d ago

Major Versions

0.3.0 → 1.0.02015-11-25

1.2.0 → 2.0.02019-07-25

1.x-dev → 2.x-dev2020-06-24

2.x-dev → 3.0.02020-07-18

3.x-dev → 4.0.0-RC12021-09-20

PHP version history (5 changes)v0.1.0PHP &gt;=5.3.0

v0.2.0PHP &gt;=5.4.0

1.0.0PHP &gt;=5.5.0

3.0.0PHP &gt;=7.2

4.0.0-RC1PHP &gt;=7.3

### 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 (68 commits)")[![jenssegers](https://avatars.githubusercontent.com/u/194377?v=4)](https://github.com/jenssegers "jenssegers (2 commits)")[![hareland](https://avatars.githubusercontent.com/u/32701939?v=4)](https://github.com/hareland "hareland (1 commits)")[![marcus-at-localhost](https://avatars.githubusercontent.com/u/1337223?v=4)](https://github.com/marcus-at-localhost "marcus-at-localhost (1 commits)")[![mikepsinn](https://avatars.githubusercontent.com/u/2808553?v=4)](https://github.com/mikepsinn "mikepsinn (1 commits)")

---

Tags

logphpmiddlewarebrowserprofilerGuzzleprofilingDevtoolsClockwork

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[hannesvdvreken/guzzle-debugbar

A Guzzle middleware that logs requests to debugbar's timeline

76410.4k1](/packages/hannesvdvreken-guzzle-debugbar)[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)[rtheunissen/guzzle-log-middleware

Guzzle middleware to log requests and responses

842.3M17](/packages/rtheunissen-guzzle-log-middleware)[gmponos/guzzle_logger

A Guzzle middleware to log request and responses automatically

772.2M6](/packages/gmponos-guzzle-logger)

PHPackages © 2026

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