Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (16 sloc) 761 Bytes

History Plugin

The HistoryPlugin notifies a Http\Client\Common\Plugin\Journal of all successful and failed calls:

use Http\Discovery\HttpClientDiscovery;
use Http\Client\Common\PluginClient;
use Http\Client\Common\Plugin\HistoryPlugin;

$historyPlugin = new HistoryPlugin(new \My\Journal\Implementation());

$pluginClient = new PluginClient(
    HttpClientDiscovery::find(),
    [$historyPlugin]
);

As an example, HttplugBundle uses this plugin to collect responses and exceptions associated with requests for the debug toolbar.

This plugin only collects data after resolution. For logging purposes, it is recommended to use the :doc:`LoggerPlugin <logger>` instead, which logs events as they occur.