Guzzle middleware handler

Installs: 14

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 1

Open Issues: 0


dev-master / 1.0.x-dev 2020-06-08 13:44 UTC

This package is auto-updated.

Last update: 2023-11-08 21:29:21 UTC


The TYPO3 CMS uses the internal Request Factory to initiate the Guzzle client class. Guzzle has handlers and middlewares to define custom stuff. To log your HTTP requests or responses, you are able to register an additional Guzzle middlware to the HandlerStack of Guzzle.

In the custom middleware you are able to log the requests to the TYPO3 core log files or create a custom logging destination. (see TYPO3 Logging Framework)


composer require jblocks/t3guzzlelog dev-master Activate the extension via the ExtensionManager in T3 Backend.

Usage (CLI)

Go to your console and execute ./bin/typo3 jblocks:t3guzzlelog Add a Xdebug breakpoint in the "ClientLogger" class.


Add custom middleware to default Guzzle handler stack

$GLOBALS['TYPO3_CONF_VARS']['HTTP']['handler'][] =
$GLOBALS['TYPO3_CONF_VARS']['HTTP']['handler'][] =

Overwrite the whole Guzzle middleware handler stack with custom class

# AdditionalConfiguration
GLOBALS['TYPO3_CONF_VARS']['HTTP']['handler'] = (\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\ACME\Middleware\Guzzle\HandlerStack::class))->handler();

# Class to overwrite the default Guzzle handlerstack

namespace \ACME\Middleware\Guzzle;

class HandlerStack
    public function handler(): HandlerStack
        $stack = \GuzzleHttp\HandlerStack::create()();
        $customHandler = (new MyCustomHandler())->foo();

        return $stack;