igor-noskov/logging-soap-client

Decorator that allows you to log SOAP requests and responses. PSR-3 compatible.

1.0.0 2019-11-22 15:48 UTC

This package is auto-updated.

Last update: 2024-09-23 02:24:16 UTC


README

Decorator that allows you to log SOAP requests and responses. PSR-3 compatible. You can use it, for example, with Monolog.

License

Requirements

  • PHP 7.1 or higher
  • Composer for installation

Installation

composer require "igor-noskov/logging-soap-client"

Usage

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
    }
}