add contexts to log items
This commit is contained in:
parent
fe60f1102d
commit
73694a1c57
@ -68,7 +68,7 @@ class Client
|
|||||||
{
|
{
|
||||||
$options['headers']['Authorization'] = 'Bearer '.$this->accessToken;
|
$options['headers']['Authorization'] = 'Bearer '.$this->accessToken;
|
||||||
|
|
||||||
$this->getLoggerHandler()->getLogger()->debug('request '.$url, $options);
|
$this->getLoggerHandler()->getLogger()->debug('linkmobility request: '.$url, $options);
|
||||||
|
|
||||||
$response = $this->requestClient->request(
|
$response = $this->requestClient->request(
|
||||||
$method,
|
$method,
|
||||||
@ -78,7 +78,8 @@ class Client
|
|||||||
|
|
||||||
if ($response->getStatusCode() != 200) {
|
if ($response->getStatusCode() != 200) {
|
||||||
$message = sprintf(ExceptionMessages::NOK_REQUEST_RETURN, $url, $response->getStatusCode());
|
$message = sprintf(ExceptionMessages::NOK_REQUEST_RETURN, $url, $response->getStatusCode());
|
||||||
$this->getLoggerHandler()->getLogger()->error($message);
|
$response->getBody()->rewind();
|
||||||
|
$this->getLoggerHandler()->getLogger()->error($message, [$response->getBody()->getContents()]);
|
||||||
throw new ApiException($message);
|
throw new ApiException($message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,9 +76,9 @@ class RecipientsList implements RecipientsListInterface, Iterator
|
|||||||
|
|
||||||
$this->recipients[ md5(serialize($recipient)) ] = $recipient;
|
$this->recipients[ md5(serialize($recipient)) ] = $recipient;
|
||||||
} catch (NumberParseException $e) {
|
} catch (NumberParseException $e) {
|
||||||
$this->client->getLoggerHandler()->getLogger()->info($e->getMessage());
|
$this->client->getLoggerHandler()->getLogger()->info($e->getMessage(), [$recipient]);
|
||||||
} catch (RecipientException $e) {
|
} catch (RecipientException $e) {
|
||||||
$this->client->getLoggerHandler()->getLogger()->info($e->getMessage());
|
$this->client->getLoggerHandler()->getLogger()->info($e->getMessage(), [$recipient]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user