Class Guzzle\Plugin\Backoff\BackoffLogger

InheritanceGuzzle\Plugin\Backoff\BackoffLogger
ImplementsSymfony\Component\EventDispatcher\EventSubscriberInterface

Logs backoff retries triggered from the BackoffPlugin

Format your log messages using a template that can contain template substitutions found in {@see 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

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$formatter Guzzle\Log\MessageFormatter Formatter used to format log messages Guzzle\Plugin\Backoff\BackoffLogger
$logger Guzzle\Log\LogAdapterInterface Logger used to log retries Guzzle\Plugin\Backoff\BackoffLogger

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
DEFAULT_FORMAT '[{ts}] {method} {url} - {code} {phrase} - Retries: {retries}, Delay: {delay}, Time: {connect_time}, {total_time}, cURL: {curl_code} {curl_error}' Guzzle\Plugin\Backoff\BackoffLogger

Property Details

$formatter protected property

Formatter used to format log messages

$logger protected property

Logger used to log retries

Method Details

__construct() public method

public void __construct ( Guzzle\Log\LogAdapterInterface $logger, Guzzle\Log\MessageFormatter $formatter null )
$logger Guzzle\Log\LogAdapterInterface

Logger used to log the retries

$formatter Guzzle\Log\MessageFormatter

Formatter used to format log messages

getSubscribedEvents() public static method

public static void getSubscribedEvents ( )
onRequestRetry() public method

Called when a request is being retried

public void onRequestRetry ( Guzzle\Common\Event $event )
$event Guzzle\Common\Event

Event emitted

setTemplate() public method

Set the template to use for logging

public self setTemplate ( $template )
$template string

Log message template