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()

No description

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 125
__construct()

at line 136
string getRequestMethod()

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

Generated from protobuf field string request_method = 1;

Return Value

string

at line 148
$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 164
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 178
$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 193
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 206
$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 221
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 234
$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 249
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 262
$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 277
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 290
$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 305
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 318
$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 333
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 346
$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 361
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 374
$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 389
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 402
$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 416
bool getCacheLookup()

Whether or not a cache lookup was attempted.

Generated from protobuf field bool cache_lookup = 11;

Return Value

bool

at line 428
$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 443
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 456
$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 472
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 486
$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 501
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 514
$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 528
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 540
$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