From c80337346d565e9ea6be24bf89fc7fa95cae50a0 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Rousseau Date: Mon, 19 Feb 2018 14:37:25 +0100 Subject: [PATCH] correction des logs trop verbeux ou manquants pour les appels SOAP. Passage de certains logs de info vers debug --- .../Foundation/Fuse/Command/Soap/SoapCommand.php | 16 ++++++++++++++-- .../Foundation/Fuse/Handler/CommandHandler.php | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Digitick/Foundation/Fuse/Command/Soap/SoapCommand.php b/src/Digitick/Foundation/Fuse/Command/Soap/SoapCommand.php index 1d60739..b00cd67 100644 --- a/src/Digitick/Foundation/Fuse/Command/Soap/SoapCommand.php +++ b/src/Digitick/Foundation/Fuse/Command/Soap/SoapCommand.php @@ -157,10 +157,11 @@ public function run() throw new \RuntimeException(); try { - $this->debug("Send request"); + $this->debug("Send request" . $this->getMethodName()); $response = $this->soapClient->__soapCall($this->getMethodName(), $this->getQuery()); - $this->info($this->soapClient->__getLastResponse()); + $this->logSoapRequestAndResponse(); } catch (SoapFault $fault) { + $this->logSoapRequestAndResponse(); $this->error(sprintf("Transfer exception caught. Type : %s, status code = %s, message = %s", get_class($fault), $fault->getCode(), @@ -178,4 +179,15 @@ public function run() return $this->content; } + + /** + * logs SOAP request and SOAP Response + */ + private function logSoapRequestAndResponse() + { + $this->info("Request:"); + $this->info($this->soapClient->__getLastRequest()); + $this->info("Response:"); + $this->info($this->soapClient->__getLastResponse()); + } } \ No newline at end of file diff --git a/src/Digitick/Foundation/Fuse/Handler/CommandHandler.php b/src/Digitick/Foundation/Fuse/Handler/CommandHandler.php index 97ae7ff..18f0c04 100644 --- a/src/Digitick/Foundation/Fuse/Handler/CommandHandler.php +++ b/src/Digitick/Foundation/Fuse/Handler/CommandHandler.php @@ -43,7 +43,7 @@ public function execute (AbstractCommand $command) { $command->setLogger($this->logger); } - $this->info("Exceute command " . get_class($command)); + $this->debug("Execute command " . get_class($command)); if ($isCacheable) { $cacheKey = $this->getCommandCacheKey($command); @@ -74,7 +74,7 @@ public function execute (AbstractCommand $command) { } catch (LogicException $exc) { $this->log(LogLevel::DEBUG, "Logic exception. Call onLogicError"); $this->log(LogLevel::INFO, "Success for command group " . $command->getKey()); - $this->circuitBreaker->reportSuccess($command->getKey()); + $this->circuitBreaker->reportSuccess($commaqnd->getKey()); return $command->onLogicError($exc); } catch (ServiceException $exc) { $this->log(LogLevel::DEBUG, "Service exception. Call onServiceError");