PHPackages                             jblocks/t3guzzlelog - 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. jblocks/t3guzzlelog

ActiveTypo3-cms-extension[HTTP &amp; Networking](/categories/http)

jblocks/t3guzzlelog
===================

Guzzle middleware handler

0141PHP

Since Jun 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/JBlocks/t3guzzlelog)[ Packagist](https://packagist.org/packages/jblocks/t3guzzlelog)[ RSS](/packages/jblocks-t3guzzlelog/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

TYPO3 CMS - Request Factory Client Middleware Logging
=====================================================

[](#typo3-cms----request-factory-client-middleware-logging)

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)

Installation
============

[](#installation)

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

Usage (CLI)
===========

[](#usage-cli)

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

Examples
========

[](#examples)

Add custom middleware to default Guzzle handler stack
-----------------------------------------------------

[](#add-custom-middleware-to-default-guzzle-handler-stack)

```
$GLOBALS['TYPO3_CONF_VARS']['HTTP']['handler'][] =
        (\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\ACME\Middleware\Guzzle\ACustomMiddleware::class))->handler();
$GLOBALS['TYPO3_CONF_VARS']['HTTP']['handler'][] =
        (\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\ACME\Middleware\Guzzle\ASecondCustomMiddleware::class))->handler();

```

Overwrite the whole Guzzle middleware handler stack with custom class
---------------------------------------------------------------------

[](#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
