Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • VivaPayments
      • Message
  • PHP

Classes

  • AbstractLogAdapter
  • ArrayLogAdapter
  • ClosureLogAdapter
  • MessageFormatter
  • MonologLogAdapter
  • PsrLogAdapter
  • Zf1LogAdapter
  • Zf2LogAdapter

Interfaces

  • LogAdapterInterface
  • Overview
  • Namespace
  • Class
  • Tree

Class MessageFormatter

Message formatter used in various places in the framework

Format messages using a template that can contain the the following variables:

  • {request}: Full HTTP request message
  • {response}: Full HTTP response message
  • {ts}: Timestamp
  • {host}: Host of the request
  • {method}: Method of the request
  • {url}: URL of the request
  • {host}: Host of the request
  • {protocol}: Request protocol
  • {version}: Protocol version
  • {resource}: Resource of the request (path + query + fragment)
  • {port}: Port of the request
  • {hostname}: Hostname of the machine that sent the request
  • {code}: Status code of the response (if available)
  • {phrase}: Reason phrase of the response (if available)
  • {curl_error}: Curl error message (if available)
  • {curl_code}: Curl error code (if available)
  • {curl_stderr}: Curl standard error (if available)
  • {connect_time}: Time in seconds it took to establish the connection (if available)
  • {total_time}: Total transaction time in seconds for last transfer (if available)
  • {req_header_*}: Replace * with the lowercased name of a request header to add to the message
  • {res_header_*}: Replace * with the lowercased name of a response header to add to the message
  • {req_body}: Request body
  • {res_body}: Response body
Namespace: Guzzle\Log
Located at src/Guzzle/Log/MessageFormatter.php
Methods summary
public
# __construct( string $template = self::DEFAULT_FORMAT )

Parameters

$template
Log message template
public Guzzle\Log\MessageFormatter
# setTemplate( string $template )

Set the template to use for logging

Set the template to use for logging

Parameters

$template
Log message template

Returns

Guzzle\Log\MessageFormatter
public string
# format( Guzzle\Http\Message\RequestInterface $request, Guzzle\Http\Message\Response $response = null, Guzzle\Http\Curl\CurlHandle $handle = null, array $customData = array() )

Returns a formatted message

Returns a formatted message

Parameters

$request
Request that was sent
$response
Response that was received
$handle
Curl handle associated with the message
$customData
Associative array of custom template data

Returns

string
Constants summary
string DEFAULT_FORMAT
# "{hostname} {req_header_User-Agent} - [{ts}] \"{method} {resource} {protocol}/{version}\" {code} {res_header_Content-Length}"
string DEBUG_FORMAT
# ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{curl_stderr}"
string SHORT_FORMAT
# '[{ts}] "{method} {resource} {protocol}/{version}" {code}'
Properties summary
protected string $template

Template used to format log messages

Template used to format log messages

#
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen