\Guzzle\Plugin\BackoffBackoffLogger

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

Summary

Methods
Properties
Constants
__construct()
getSubscribedEvents()
setTemplate()
onRequestRetry()
No public properties found
DEFAULT_FORMAT
No protected methods found
$logger
$formatter
N/A
No private methods found
No private properties found
N/A

Constants

DEFAULT_FORMAT

DEFAULT_FORMAT = '[{ts}] {method} {url} - {code} {phrase} - Retries: {retries}, Delay: {delay}, Time: {connect_time}, {total_time}, cURL: {curl_code} {curl_error}' : string

Properties

Methods

getSubscribedEvents()

getSubscribedEvents() : array

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

  • The method name to call (priority defaults to 0)
  • An array composed of the method name to call and the priority
  • An array of arrays composed of the method names to call and respective priorities, or 0 if unset

For instance:

  • array('eventName' => 'methodName')
  • array('eventName' => array('methodName', $priority))
  • array('eventName' => array(array('methodName1', $priority), array('methodName2')))

Returns

array —

The event names to listen to

setTemplate()

setTemplate(string  $template) : self

Set the template to use for logging

Parameters

string $template

Log message template

Returns

self

onRequestRetry()

onRequestRetry(\Guzzle\Common\Event  $event) 

Called when a request is being retried

Parameters

\Guzzle\Common\Event $event

Event emitted