Class BackoffLogger
Logs backoff retries triggered from the BackoffPlugin
Format your log messages using a template that can contain template
substitutions found in Guzzle\Log\MessageFormatter
. In addition to the default
template substitutions, there is also:
- retries: The number of times the request has been retried
- delay: The amount of time the request is being delayed
- Guzzle\Plugin\Backoff\BackoffLogger implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Methods summary
-
public
__construct ( Guzzle\Log\LogAdapterInterface $logger, Guzzle\Log\MessageFormatter $formatter = null )
-
public static
getSubscribedEvents ( )
-
public
setTemplate ( string $template )
Set the template to use for logging
-
public
onRequestRetry ( Guzzle\Common\Event $event )
Called when a request is being retried
Methods detail
#
public
__construct( Guzzle\Log\LogAdapterInterface
$logger, Guzzle\Log\MessageFormatter
$formatter = null )
Parameters
- $logger
Guzzle\Log\LogAdapterInterface
$logger Logger used to log the retries- $formatter
Guzzle\Log\MessageFormatter
$formatter Formatter used to format log messages
Set the template to use for logging
Parameters
- $template
string
$template Log message template
Returns
Magic methods summary
Constants summary
string |
DEFAULT_FORMAT |
'[{ts}] {method} {url} - {code} {phrase} - Retries: {retries}, Delay: {delay}, Time: {connect_time}, {total_time}, cURL: {curl_code} {curl_error}' |
#
Default log message template |
Properties summary
protected
|
$logger |
#
Logger used to log retries |
protected
|
$formatter |
#
Formatter used to format log messages |