Ayúdanos a definir el futuro de las operaciones de software y haz oír tu voz con la encuesta del estado de DevOps 2021.

Todas las muestras de código de Logging

This page contains code samples for Cloud Logging. To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.

Bunyan and Express

Demonstrates how to set up and use Bunyan with Cloud Logging in a Node.js Express application.

View in documentation

Bunyan quickstart

Demonstrates how to set up Bunyan in a Node.js application.

View in documentation

Create a sink

Demonstrates how to create a Cloud Logging Sink.

Delete a log

Demonstrates how to delete a Log.

View in documentation

Delete a sink

Demonstrates how to delete a Cloud Logging Sink.

Get a sink

Demonstrates how to retrieve the metadata for a Cloud Logging Sink.

View in documentation

List log entries

Demonstrates how to list log entries.

View in documentation

List logs

Demonstrates how to list the names of available Logs.

View in documentation

List sinks

Demonstrates how to list Cloud Logging Sinks.

Logging quickstart

Demonstration of how to write a log entry.

View in documentation

Tail log entries

Demonstrates how to tail live log entries.

Update a sink

Demonstrates how to update a Cloud Logging Sink.

Winston quickstart

Demonstrates how to set up Winston in a Node.js application.

View in documentation

Write request logs

An example of how to log HTTP request logs.

View in documentation

Write standard logs

Demonstrates how to use Cloud Logging in a standard library-compatible way.

Write structured logs

Demonstrates how to write a log entry.

View in documentation