Decorator that allows you to log SOAP requests and responses. PSR-3 compatible. You can use it, for example, with Monolog.
- PHP 7.1 or higher
- Composer for installation
composer require "igor-noskov/logging-soap-client"
You can use it like this:
<?php
use IgorNoskov\LoggingSoapClient\LoggingSoapClient;
use Psr\Log\LoggerInterface;
class Foo
{
public function doSomething(string $wsdl, LoggerInterface $logger)
{
$soapClient = new LoggingSoapClient(new SoapClient($wsdl, ['trace' => true]), $logger);
// do something useful
}
}