Overview

Namespaces

  • Docta
    • MercadoLibre
      • OAuth2
        • Client
  • GuzzleHttp
    • Cookie
    • Exception
    • Handler
    • Promise
    • Psr7
  • League
    • OAuth2
      • Client
        • Grant
          • Exception
        • Provider
          • Exception
        • Token
        • Tool
  • Psr
    • Http
      • Message

Classes

  • Client
  • HandlerStack
  • MessageFormatter
  • Middleware
  • Pool
  • PrepareBodyMiddleware
  • RedirectMiddleware
  • RequestOptions
  • RetryMiddleware
  • TransferStats
  • UriTemplate

Interfaces

  • ClientInterface

Functions

  • choose_handler
  • debug_resource
  • default_ca_bundle
  • default_user_agent
  • describe_type
  • headers_from_lines
  • is_host_in_noproxy
  • json_decode
  • json_encode
  • normalize_header_keys
  • uri_template
  • Overview
  • Namespace
  • Class
  • Download

Class MessageFormatter

Formats log messages using variable substitutions for requests, responses, and other transactional data.

The following variable substitutions are supported:

  • {request}: Full HTTP request message
  • {response}: Full HTTP response message
  • {ts}: ISO 8601 date in GMT
  • {date_iso_8601} ISO 8601 date in GMT
  • {date_common_log} Apache common log date using the configured timezone.
  • {host}: Host of the request
  • {method}: Method of the request
  • {uri}: URI of the request
  • {version}: Protocol version
  • {target}: Request target of the request (path + query + fragment)
  • {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)
  • {error}: Any error messages (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_headers}: Request headers
  • {res_headers}: Response headers
  • {req_body}: Request body
  • {res_body}: Response body
Namespace: GuzzleHttp
Located at src/MessageFormatter.php
Methods summary
public
# __construct( string $template = self::CLF )

Parameters

$template
Log message template
public string
# format( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response = null, Exception $error = null )

Returns a formatted message string.

Returns a formatted message string.

Parameters

$request
Request that was sent
$response
Response that was received
$error
Exception that was received

Returns

string
Constants summary
string CLF

Apache Common Log Format.

Apache Common Log Format.

Link

http://httpd.apache.org/docs/2.4/logs.html#common
# "{hostname} {req_header_User-Agent} - [{date_common_log}] \"{method} {target} HTTP/{version}\" {code} {res_header_Content-Length}"
string DEBUG
# ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"
string SHORT
# '[{ts}] "{method} {target} HTTP/{version}" {code}'
MercadoLibre Provider for OAuth 2.0 Client API documentation generated by ApiGen