Copied!

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

CloneableInstantiable
Methods
public __construct( $data = NULL)
 

Constructor.

  • param 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. This field can include port information. Examples: `"192.168.1.1"`, `"10.0.0.1:80"`, `"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. This field can include port information. Examples: `"192.168.1.1"`, `"10.0.0.1:80"`, `"FE80::0202:B3FF:FE1E:8329"`. @type string $referer The referer URL of the request, as defined in [HTTP/1.1 Header Field Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36). @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" 
    }
public Google\Protobuf\Internal\Message::__debugInfo()
public Google\Protobuf\Internal\Message::byteSize()
 
  • ignore
public Google\Protobuf\Internal\Message::clear()
 

Clear all containing fields.

  • return null
public clearLatency()
public Google\Protobuf\Internal\Message::discardUnknownFields()
 

Clear all unknown fields previously parsed.

  • return null
public 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 int|string
public getCacheHit()
 

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

Generated from protobuf field bool cache_hit = 9;

  • return bool
public getCacheLookup()
 

Whether or not a cache lookup was attempted.

Generated from protobuf field bool cache_lookup = 11;

  • return bool
public 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 bool
public 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 \Google\Protobuf\Duration|null
public getProtocol()
 

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

Generated from protobuf field string protocol = 15;

  • return string
public getReferer()
 

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

Generated from protobuf field string referer = 8;

  • return string
public getRemoteIp()
 

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

Generated from protobuf field string remote_ip = 7;

  • return string
public getRequestMethod()
 

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

Generated from protobuf field string request_method = 1;

  • return string
public 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 int|string
public 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 string
public 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 int|string
public getServerIp()
 

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

Generated from protobuf field string server_ip = 13;

  • return string
public getStatus()
 

The response code indicating the status of response.

Examples: 200, 404.

Generated from protobuf field int32 status = 4;

  • return int
public 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 string
public hasLatency()
public Google\Protobuf\Internal\Message::jsonByteSize( $options = 0)
 
  • ignore
public Google\Protobuf\Internal\Message::mergeFrom( $msg)
 

Merges the contents of the specified message into current message.

This method merges the contents of the specified message into the current message. Singular fields that are set in the specified message overwrite the corresponding fields in the current message. Repeated fields are appended. Map fields key-value pairs are overwritten. Singular/Oneof sub-messages are recursively merged. All overwritten sub-messages are deep-copied.

  • param object $msg Protobuf message to be merged from.
  • return null
public Google\Protobuf\Internal\Message::mergeFromJsonString( $data, $ignore_unknown = false)
 

Parses a json string to protobuf message.

This function takes a string in the json wire format, matching the encoding output by serializeToJsonString(). See mergeFrom() for merging behavior, if the field is already set in the specified message.

  • param string $data Json protobuf data.
  • param bool $ignore_unknown
  • return null
  • throws \Exception Invalid data.
public Google\Protobuf\Internal\Message::mergeFromString( $data)
 

Parses a protocol buffer contained in a string.

This function takes a string in the (non-human-readable) binary wire format, matching the encoding output by serializeToString(). See mergeFrom() for merging behavior, if the field is already set in the specified message.

  • param string $data Binary protobuf data.
  • return null
  • throws \Exception Invalid data.
public Google\Protobuf\Internal\Message::parseFromJsonStream( $input, $ignore_unknown)
 
  • ignore
public Google\Protobuf\Internal\Message::parseFromStream( $input)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToJsonStream( $output)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToJsonString( $options = 0)
 

Serialize the message to json string.

  • return string Serialized json protobuf data.
public Google\Protobuf\Internal\Message::serializeToStream( $output)
 
  • ignore
public Google\Protobuf\Internal\Message::serializeToString()
 

Serialize the message to string.

  • return string Serialized binary protobuf data.
public setCacheFillBytes( $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;

  • param int|string $var
  • return $this
public setCacheHit( $var)
 

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

Generated from protobuf field bool cache_hit = 9;

  • param bool $var
  • return $this
public setCacheLookup( $var)
 

Whether or not a cache lookup was attempted.

Generated from protobuf field bool cache_lookup = 11;

  • param bool $var
  • return $this
public setCacheValidatedWithOriginServer( $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;

  • param bool $var
  • return $this
public setLatency( $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;

  • param \Google\Protobuf\Duration $var
  • return $this
public setProtocol( $var)
 

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

Generated from protobuf field string protocol = 15;

  • param string $var
  • return $this
public setReferer( $var)
 

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

Generated from protobuf field string referer = 8;

  • param string $var
  • return $this
public setRemoteIp( $var)
 

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

Generated from protobuf field string remote_ip = 7;

  • param string $var
  • return $this
public setRequestMethod( $var)
 

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

Generated from protobuf field string request_method = 1;

  • param string $var
  • return $this
public setRequestSize( $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;

  • param int|string $var
  • return $this
public setRequestUrl( $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;

  • param string $var
  • return $this
public setResponseSize( $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;

  • param int|string $var
  • return $this
public setServerIp( $var)
 

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

Generated from protobuf field string server_ip = 13;

  • param string $var
  • return $this
public setStatus( $var)
 

The response code indicating the status of response.

Examples: 200, 404.

Generated from protobuf field int32 status = 4;

  • param int $var
  • return $this
public setUserAgent( $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;

  • param string $var
  • return $this
Properties
protected $cache_fill_bytes = 0
 

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;

protected $cache_hit = false
 

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

Generated from protobuf field bool cache_hit = 9;

protected $cache_lookup = false
 

Whether or not a cache lookup was attempted.

Generated from protobuf field bool cache_lookup = 11;

protected $cache_validated_with_origin_server = false
 

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;

protected $latency = NULL
 

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;

protected $protocol = ''
 

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

Generated from protobuf field string protocol = 15;

protected $referer = ''
 

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

Generated from protobuf field string referer = 8;

protected $remote_ip = ''
 

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

Generated from protobuf field string remote_ip = 7;

protected $request_method = ''
 

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

Generated from protobuf field string request_method = 1;

protected $request_size = 0
 

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;

protected $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".

Generated from protobuf field string request_url = 2;

protected $response_size = 0
 

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;

protected $server_ip = ''
 

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

Generated from protobuf field string server_ip = 13;

protected $status = 0
 

The response code indicating the status of response.

Examples: 200, 404.

Generated from protobuf field int32 status = 4;

protected $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)".

Generated from protobuf field string user_agent = 6;

Methods
protected Google\Protobuf\Internal\Message::hasOneof( $number)
protected Google\Protobuf\Internal\Message::mergeFromArray(array $array)
 

Populates the message from a user-supplied PHP array. Array keys correspond to Message properties and nested message properties.

Example:

$message->mergeFromArray([ 'name' => 'This is a message name', 'interval' => [ 'startTime' => time() - 60, 'endTime' => time(), ] ]); 

This method will trigger an error if it is passed data that cannot be converted to the correct type. For example, a StringValue field must receive data that is either a string or a StringValue object.

  • param array $array An array containing message properties and values.
  • return null
protected Google\Protobuf\Internal\Message::mergeFromJsonArray( $array, $ignore_unknown)
protected Google\Protobuf\Internal\Message::readOneof( $number)
protected Google\Protobuf\Internal\Message::readWrapperValue( $member)
protected Google\Protobuf\Internal\Message::whichOneof( $oneof_name)
protected Google\Protobuf\Internal\Message::writeOneof( $number, $value)
protected Google\Protobuf\Internal\Message::writeWrapperValue( $member, $value)
© 2025 Bruce Wells