Moodle PHP Documentation 4.5
Moodle 4.5dev (Build: 20240606) (d3ae1391abe)
GuzzleHttp\MessageFormatter Class Reference
Inheritance diagram for GuzzleHttp\MessageFormatter:
GuzzleHttp\MessageFormatterInterface

Public Member Functions

 __construct (?string $template=self::CLF)
 
 format (RequestInterface $request, ResponseInterface $response=null, Throwable $error=null)
 Returns a formatted message string.
 

Public Attributes

string const CLF = '{hostname} {req_header_User-Agent} - [{date_common_log}] "{method} {target} HTTP/{version}" {code} {res_header_Content-Length}'
 Apache Common Log Format.
 
const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"
 
const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'
 

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\MessageFormatter::__construct ( ?string $template = self::CLF)
Parameters
string$templateLog message template

Member Function Documentation

◆ format()

GuzzleHttp\MessageFormatter::format ( RequestInterface $request,
ResponseInterface $response = null,
Throwable $error = null )

Returns a formatted message string.

Parameters
RequestInterface$requestRequest that was sent
ResponseInterface | null$responseResponse that was received
Throwable | null$errorException that was received

Implements GuzzleHttp\MessageFormatterInterface.

Member Data Documentation

◆ CLF

string const GuzzleHttp\MessageFormatter::CLF = '{hostname} {req_header_User-Agent} - [{date_common_log}] "{method} {target} HTTP/{version}" {code} {res_header_Content-Length}'

Apache Common Log Format.

See also
https://httpd.apache.org/docs/2.4/logs.html#common

The documentation for this class was generated from the following file: