diff --git a/src/DependencyInjection/EightPointsGuzzleExtension.php b/src/DependencyInjection/EightPointsGuzzleExtension.php index 5266374..ac65d7b 100644 --- a/src/DependencyInjection/EightPointsGuzzleExtension.php +++ b/src/DependencyInjection/EightPointsGuzzleExtension.php @@ -123,14 +123,14 @@ protected function createHandler(ContainerBuilder $container, string $name, arra $handler = new Definition(HandlerStack::class); $handler->setFactory([HandlerStack::class, 'create']); + $handler->addMethodCall('push', [$logExpression, 'log']); foreach ($this->plugins as $plugin) { $plugin->loadForClient($config['plugin'][$plugin->getPluginName()], $container, $name, $handler); } - $handler->addMethodCall('push', [$logExpression]); // goes on the end of the stack. - $handler->addMethodCall('unshift', [$eventExpression]); + $handler->addMethodCall('unshift', [$eventExpression, 'events']); return $handler; }