Endpoints logs

When users make requests to your API, Extensible Service Proxy (ESP) uses Cloud Logging to log information about the requests and responses. This page describes the information logged.

To locate Cloud Endpoints logs on the Logs Explorer page:

  1. In the Google Cloud console, go to the Stackdriver > Logging page:

    Go to the Logs Explorer page

  2. Select Produced API, SERVICE_NAME, where SERVICE_NAME is the name of the Endpoints service.

  3. Click the log you want to investigate. The log contains a structured JSON message such as the following:

    {
      insertId: "…"
      jsonPayload: {…}
      resource: {
        type: "api"
        labels: {…}
      }
      timestamp: "2017-05-08T15:00:02.804424422Z"
      severity: "INFO"
      logName: "…"
    }
    

The jsonPayload object contains all the information reported by ESP. The following table describes its fields:

Field Description
url URL path of the request.
producer_project_id Google Cloud project ID that owns the API.
api_name Name of the API invoked.
api_version Version of the named API invoked.
api_method Method of the named API invoked.
api_key API key used by the calling consumer, if present.
http_method HTTP method of the request such as GET and POST.
request_size_in_bytes Size of request body in bytes.
http_response_code HTTP status code of the response such as 200, 404, and 500.
response_size_in_bytes Size of the response body in bytes.
request_latency_in_ms Time it took to respond to the request in milliseconds, including the time taken by ESP and its backend. Not present for streaming methods.
timestamp Timestamp for when the request came in.
location Google Cloud zone that serviced the request.
log_message Short message about the called method and its status if it is rejected. No API information fields are logged for rejected calls.
error_cause Error message if the response was an error.
labels The labels section contains information that identifies that source of the log, such as the Google Cloud project ID, the Endpoints service name, the API version number, and the method name.

What's next