Skip to content

Commit

Permalink
correction des logs trop verbeux ou manquants pour les appels SOAP.
Browse files Browse the repository at this point in the history
Passage de certains logs de info vers debug
  • Loading branch information
jbrousseauDigitick committed Feb 19, 2018
1 parent 45bda3e commit c803373
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions src/Digitick/Foundation/Fuse/Command/Soap/SoapCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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());
}
}
4 changes: 2 additions & 2 deletions src/Digitick/Foundation/Fuse/Handler/CommandHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit c803373

Please sign in to comment.