class HttpRequest extends Message

A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.

Generated from protobuf message google.logging.type.HttpRequest

Methods

__construct(array $data = NULL)

Constructor.

string
getRequestMethod()

The request method. Examples: "GET", "HEAD", "PUT", "POST".

$this
setRequestMethod(string $var)

The request method. Examples: "GET", "HEAD", "PUT", "POST".

string
getRequestUrl()

The scheme (http, https), the host name, the path and the query portion of the URL that was requested.

$this
setRequestUrl(string $var)

The scheme (http, https), the host name, the path and the query portion of the URL that was requested.

int|string
getRequestSize()

The size of the HTTP request message in bytes, including the request headers and the request body.

$this
setRequestSize(int|string $var)

The size of the HTTP request message in bytes, including the request headers and the request body.

int
getStatus()

The response code indicating the status of response.

$this
setStatus(int $var)

The response code indicating the status of response.

int|string
getResponseSize()

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

$this
setResponseSize(int|string $var)

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

string
getUserAgent()

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

$this
setUserAgent(string $var)

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

string
getRemoteIp()

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

$this
setRemoteIp(string $var)

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

string
getServerIp()

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

$this
setServerIp(string $var)

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

string
getReferer()

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

$this
setReferer(string $var)

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

Duration
getLatency()

The request processing latency on the server, from the time the request was received until the response was sent.

$this
setLatency(Duration $var)

The request processing latency on the server, from the time the request was received until the response was sent.

bool
getCacheLookup()

Whether or not a cache lookup was attempted.

$this
setCacheLookup(bool $var)

Whether or not a cache lookup was attempted.

bool
getCacheHit()

Whether or not an entity was served from cache (with or without validation).

$this
setCacheHit(bool $var)

Whether or not an entity was served from cache (with or without validation).

bool
getCacheValidatedWithOriginServer()

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

$this
setCacheValidatedWithOriginServer(bool $var)

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

int|string
getCacheFillBytes()

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

$this
setCacheFillBytes(int|string $var)

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

string
getProtocol()

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

$this
setProtocol(string $var)

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

Details

at line 177
__construct(array $data = NULL)

Constructor.

Parameters

array $data { Optional. Data for populating the Message object.

@type string $request_method
      The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
@type string $request_url
      The scheme (http, https), the host name, the path and the query
      portion of the URL that was requested.
      Example: `"http://example.com/some/info?color=red"`.
@type int|string $request_size
      The size of the HTTP request message in bytes, including the request
      headers and the request body.
@type int $status
      The response code indicating the status of response.
      Examples: 200, 404.
@type int|string $response_size
      The size of the HTTP response message sent back to the client, in bytes,
      including the response headers and the response body.
@type string $user_agent
      The user agent sent by the client. Example:
      `"Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)"`.
@type string $remote_ip
      The IP address (IPv4 or IPv6) of the client that issued the HTTP
      request. Examples: `"192.168.1.1"`, `"FE80::0202:B3FF:FE1E:8329"`.
@type string $server_ip
      The IP address (IPv4 or IPv6) of the origin server that the request was
      sent to.
@type string $referer
      The referer URL of the request, as defined in
      [HTTP/1.1 Header Field Definitions](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html).
@type \Google\Protobuf\Duration $latency
      The request processing latency on the server, from the time the request was
      received until the response was sent.
@type bool $cache_lookup
      Whether or not a cache lookup was attempted.
@type bool $cache_hit
      Whether or not an entity was served from cache
      (with or without validation).
@type bool $cache_validated_with_origin_server
      Whether or not the response was validated with the origin server before
      being served from cache. This field is only meaningful if `cache_hit` is
      True.
@type int|string $cache_fill_bytes
      The number of HTTP response bytes inserted into cache. Set only when a
      cache fill was attempted.
@type string $protocol
      Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

}

at line 188
string getRequestMethod()

The request method. Examples: "GET", "HEAD", "PUT", "POST".

Generated from protobuf field string request_method = 1;

Return Value

string

at line 200
$this setRequestMethod(string $var)

The request method. Examples: "GET", "HEAD", "PUT", "POST".

Generated from protobuf field string request_method = 1;

Parameters

string $var

Return Value

$this

at line 216
string getRequestUrl()

The scheme (http, https), the host name, the path and the query portion of the URL that was requested.

Example: "http://example.com/some/info?color=red".

Generated from protobuf field string request_url = 2;

Return Value

string

at line 230
$this setRequestUrl(string $var)

The scheme (http, https), the host name, the path and the query portion of the URL that was requested.

Example: "http://example.com/some/info?color=red".

Generated from protobuf field string request_url = 2;

Parameters

string $var

Return Value

$this

at line 245
int|string getRequestSize()

The size of the HTTP request message in bytes, including the request headers and the request body.

Generated from protobuf field int64 request_size = 3;

Return Value

int|string

at line 258
$this setRequestSize(int|string $var)

The size of the HTTP request message in bytes, including the request headers and the request body.

Generated from protobuf field int64 request_size = 3;

Parameters

int|string $var

Return Value

$this

at line 273
int getStatus()

The response code indicating the status of response.

Examples: 200, 404.

Generated from protobuf field int32 status = 4;

Return Value

int

at line 286
$this setStatus(int $var)

The response code indicating the status of response.

Examples: 200, 404.

Generated from protobuf field int32 status = 4;

Parameters

int $var

Return Value

$this

at line 301
int|string getResponseSize()

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

Generated from protobuf field int64 response_size = 5;

Return Value

int|string

at line 314
$this setResponseSize(int|string $var)

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

Generated from protobuf field int64 response_size = 5;

Parameters

int|string $var

Return Value

$this

at line 329
string getUserAgent()

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

Generated from protobuf field string user_agent = 6;

Return Value

string

at line 342
$this setUserAgent(string $var)

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)".

Generated from protobuf field string user_agent = 6;

Parameters

string $var

Return Value

$this

at line 357
string getRemoteIp()

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

Generated from protobuf field string remote_ip = 7;

Return Value

string

at line 370
$this setRemoteIp(string $var)

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

Generated from protobuf field string remote_ip = 7;

Parameters

string $var

Return Value

$this

at line 385
string getServerIp()

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

Generated from protobuf field string server_ip = 13;

Return Value

string

at line 398
$this setServerIp(string $var)

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

Generated from protobuf field string server_ip = 13;

Parameters

string $var

Return Value

$this

at line 413
string getReferer()

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

Generated from protobuf field string referer = 8;

Return Value

string

at line 426
$this setReferer(string $var)

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

Generated from protobuf field string referer = 8;

Parameters

string $var

Return Value

$this

at line 441
Duration getLatency()

The request processing latency on the server, from the time the request was received until the response was sent.

Generated from protobuf field .google.protobuf.Duration latency = 14;

Return Value

Duration

at line 454
$this setLatency(Duration $var)

The request processing latency on the server, from the time the request was received until the response was sent.

Generated from protobuf field .google.protobuf.Duration latency = 14;

Parameters

Duration $var

Return Value

$this

at line 468
bool getCacheLookup()

Whether or not a cache lookup was attempted.

Generated from protobuf field bool cache_lookup = 11;

Return Value

bool

at line 480
$this setCacheLookup(bool $var)

Whether or not a cache lookup was attempted.

Generated from protobuf field bool cache_lookup = 11;

Parameters

bool $var

Return Value

$this

at line 495
bool getCacheHit()

Whether or not an entity was served from cache (with or without validation).

Generated from protobuf field bool cache_hit = 9;

Return Value

bool

at line 508
$this setCacheHit(bool $var)

Whether or not an entity was served from cache (with or without validation).

Generated from protobuf field bool cache_hit = 9;

Parameters

bool $var

Return Value

$this

at line 524
bool getCacheValidatedWithOriginServer()

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

Generated from protobuf field bool cache_validated_with_origin_server = 10;

Return Value

bool

at line 538
$this setCacheValidatedWithOriginServer(bool $var)

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

Generated from protobuf field bool cache_validated_with_origin_server = 10;

Parameters

bool $var

Return Value

$this

at line 553
int|string getCacheFillBytes()

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

Generated from protobuf field int64 cache_fill_bytes = 12;

Return Value

int|string

at line 566
$this setCacheFillBytes(int|string $var)

The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

Generated from protobuf field int64 cache_fill_bytes = 12;

Parameters

int|string $var

Return Value

$this

at line 580
string getProtocol()

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

Generated from protobuf field string protocol = 15;

Return Value

string

at line 592
$this setProtocol(string $var)

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

Generated from protobuf field string protocol = 15;

Parameters

string $var

Return Value

$this