Quando gli utenti inviano richieste alla tua API,
Extensible Service Proxy (ESP)
utilizza Cloud Logging per registrare informazioni
sulle richieste e sulle risposte. Questa pagina descrive le informazioni registrate.
Per trovare i log di Cloud Endpoints nella pagina Esplora log:
Nella Google Cloud console, vai alla pagina Operazioni > Logging:
L'oggetto jsonPayload contiene tutte le informazioni registrate dall'ESP. La tabella seguente descrive i relativi campi:
Campo
Descrizione
url
Percorso dell'URL della richiesta.
producer_project_id
ID progettoGoogle Cloud proprietario dell'API.
api_name
Nome dell'API invocata.
api_version
Versione dell'API denominata invocata.
api_method
Metodo dell'API denominata invocata.
api_key
Chiave API utilizzata dal consumatore chiamante, se presente.
http_method
Metodo HTTP della richiesta, ad esempio GET e POST.
request_size_in_bytes
Dimensioni del corpo della richiesta in byte.
http_response_code
Il codice di stato HTTP della risposta, ad esempio 200, 404 e 500.
response_size_in_bytes
Dimensioni del corpo della risposta in byte.
request_latency_in_ms
Tempo impiegato per rispondere alla richiesta in millisecondi, incluso il tempo impiegato dall'ESP e dal relativo backend. Non presente per i metodi di streaming.
timestamp
Timestamp della ricezione della richiesta.
location
Google Cloud che ha soddisfatto la richiesta.
log_message
Breve messaggio sul metodo chiamato e sul relativo stato se viene rifiutato. Non vengono registrati campi di informazioni API per le chiamate rifiutate.
error_cause
Messaggio di errore se la risposta è un errore.
labels
La sezione labels contiene informazioni che identificano l'origine del log, ad esempio l' Google Cloud ID progetto, il nome del servizio Endpoints, il numero di versione dell'API e il nome del metodo.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eExtensible Service Proxy (ESP) logs request and response information to Cloud Logging when users make requests to your API.\u003c/p\u003e\n"],["\u003cp\u003eYou can find Cloud Endpoints logs in the Logs Explorer page by selecting "Produced API, SERVICE_NAME," where SERVICE_NAME is the name of your Endpoints service.\u003c/p\u003e\n"],["\u003cp\u003eEach log contains a structured JSON message that includes details such as \u003ccode\u003eurl\u003c/code\u003e, \u003ccode\u003eapi_name\u003c/code\u003e, \u003ccode\u003ehttp_method\u003c/code\u003e, \u003ccode\u003ehttp_response_code\u003c/code\u003e, and \u003ccode\u003erequest_latency_in_ms\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elabels\u003c/code\u003e section in the log provides identifying information about the log's source, including the Google Cloud project ID, Endpoints service name, API version number, and method name.\u003c/p\u003e\n"]]],[],null,["# Endpoints logs\n\n[OpenAPI](/endpoints/docs/openapi/ref-endpoints-logs \"View this page for the Cloud Endpoints OpenAPI docs\") \\| gRPC\n\n\u003cbr /\u003e\n\nWhen users make requests to your API,\n[Extensible Service Proxy (ESP)](/endpoints/docs/grpc/glossary#extensible_service_proxy)\nuses Cloud Logging to log information\nabout the requests and responses. This page describes the information logged.\n\nTo locate Cloud Endpoints logs on the **Logs Explorer** page:\n\n1. In the Google Cloud console, go to the **Operations** \\\u003e **Logging**\n page:\n\n\n [Go to the Logs Explorer page](https://console.cloud.google.com/logs/query)\n\n \u003cbr /\u003e\n\n2. Select **Produced API, \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e** , where\n \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e is the name of the\n Endpoints service.\n\n | **Note:** You can select **Produced API** from the resource menu only if a recent log message contains the **API** resource type.\n\n \u003cbr /\u003e\n\n3. Click the log you want to investigate. The log contains a structured JSON\n message such as the following:\n\n {\n insertId: \"...\"\n jsonPayload: {...}\n resource: {\n type: \"api\"\n labels: {...}\n }\n timestamp: \"2017-05-08T15:00:02.804424422Z\"\n severity: \"INFO\"\n logName: \"...\"\n }\n\nThe `jsonPayload` object contains all the information reported by\nESP. The following table describes its fields:\n\nWhat's next\n-----------\n\n- [Monitoring your API](/endpoints/docs/grpc/monitoring-your-api)\n\n\u003c!-- --\u003e\n\n- [Tracing your API](/endpoints/docs/grpc/tracing)"]]