Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Muchos lenguajes de programación tienen interfaces de escritura de registros estándar que puedes volver a configurar para usar Logging.
Escribir registros
Para escribir registros en Cloud Logging, puedes realizar cualquiera de estas acciones:
Escribe tus registros en archivos de registro existentes, como syslog, en tu instancia de VM de Compute Engine y usa el agente de operaciones para enviar los registros a Cloud Logging. Para obtener más información, consulta
Agentes de Google Cloud Observability.
Configura un paquete de registro estándar para enviar los registros que escribes a Logging. Para obtener más información, consulta las siguientes páginas con detalles:
Usa la CLI de gcloud. Para obtener más información, consulta la interfaz de línea de comandos de gcloud logging.
Asocia datos de seguimiento con entradas de registro
Las entradas de registro pueden contener información sobre los seguimientos. Si incluyes datos de seguimiento
en las entradas de registro, puedes correlacionar los registros y los seguimientos para permitir una mejor
solución de problemas distribuidos. Para obtener información sobre la captura manual y automática de información de seguimiento en las entradas de registro, consulta Integración con Cloud Logging.
Lee registros
Para leer entradas de registro en Logging, puedes realizar alguna de las siguientes acciones:
En la consola de Google Cloud , ve a la página Explorador de registros.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-03 (UTC)"],[],[],null,["# Logging libraries overview\n\nMany programming languages have standard log-writing interfaces that you can reconfigure to use Logging.\n\n\u003cbr /\u003e\n\n| **Note:** You can instrument your application so that it collects application-specific information. Several open-source instrumentation frameworks let you collect metrics, logs, and traces from your application and send that data to any vendor, including Google Cloud. To instrument your application, we recommend that you use a vendor-neutral instrumentation framework that is open source, such as [OpenTelemetry](https://opentelemetry.io/), instead of vendor- and product-specific APIs or client libraries.\n|\n| \u003cbr /\u003e\n|\n| For information about instrumenting your applications by using\n| vendor-neutral instrumentation frameworks, see\n| [Instrumentation and observability](/stackdriver/docs/instrumentation/overview).\n\nWrite logs\n----------\n\nTo write logs to Cloud Logging, you can do any of\nthe following:\n\n- Write your logs to existing log files such as `syslog` on your Compute EngineVM instance and use the Ops Agent to send the logs to Cloud Logging. For more information, see [Google Cloud Observability agents](/logging/docs/agent).\n- Configure a standard logging package to send the logs you write to Logging. For more information, see the following detail pages:\n - Any language: [fluentd](https://www.fluentd.org/)\n - [C#: Using ASP.NET or calling\n the API](/logging/docs/integrate/dotnet)\n - [Java: Using Logback and\n java.util.logging](/logging/docs/setup/java)\n - [Go: Using standard logging](/logging/docs/setup/go)\n - [Node.js: Using Winston and Bunyan](/logging/docs/setup/nodejs)\n - [PHP: Using PSR-3 logger](/logging/docs/setup/php)\n - [Python: Using the standard logging\n facility](/logging/docs/setup/python)\n - [Ruby: Using the Google Cloud Observability\n gem](/logging/docs/setup/ruby)\n- Call the Logging API using Logging's [Client Libraries](/logging/docs/reference/libraries) for your programming language.\n- Call the Logging API REST endpoint directly. See the [Logging API reference documentation](/logging/docs/reference/v2/rest).\n- Use the [gcloud CLI](/sdk/docs). For more information, see the [`gcloud logging`](/logging/docs/reference/tools/gcloud-logging) command-line interface.\n\n\u003cbr /\u003e\n\n| **Note:** Incoming log entries with timestamps that are more than the [logs retention period](/logging/quotas#logs_retention_periods) in the past or that are more than 24 hours in the future are discarded.\n\nAssociate trace data with log entries\n-------------------------------------\n\nLog entries can contain information about traces. By including trace data\nin log entries, you can correlate logs and traces to enable better\ndistributed troubleshooting. For information about manual and\nautomatic capture of trace information in log entries, see\n[Integrate with Cloud Logging](/trace/docs/trace-log-integration).\n\nRead logs\n---------\n\nTo read log entries in Logging, you can do any of\nthe following:\n\n- In the Google Cloud console, go to the **Logs Explorer** page:\n\n [Go to **Logs Explorer**](https://console.cloud.google.com/logs/query)\n\n \u003cbr /\u003e\n\n If you use the search bar to find this page, then select the result whose subheading is\n **Logging**.\n\n For more information, see\n [Logs Explorer overview](/logging/docs/view/logs-explorer-interface).\n- Call the Logging API through\n the [client libraries](/logging/docs/reference/libraries) for your\n programming language.\n\n- Call the Logging API REST endpoints directly.\n See the [Logging API reference documentation](/logging/docs/reference/v2/rest).\n\n- Use the [gcloud CLI](/sdk/docs). For more information, see the\n [`gcloud logging`](/logging/docs/reference/tools/gcloud-logging) command-line interface."]]