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.

View in documentation

Delete a log

Demonstrates how to delete a Log.

View in documentation

Delete a sink

Demonstrates how to delete a Cloud Logging Sink.

View in documentation

Get a sink

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

View in documentation

Java: Logback Usage

Write logs using the Logback framework.

View in documentation

Java: Util.logging Usage

Write logs using the java.util.logging library.

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.

View in documentation

Logging quickstart

Demonstration of how to write a log entry.

View in documentation

Ruby: Configure GCP Client

Configure GCP client authentication.

View in documentation

Ruby: Configure Logging Client

Configure logging-specific client authentication.

Ruby: Configure Rails GCP Client

Configure GCP client authentication for Rails.

View in documentation

Ruby: Configure Rails Logging Client

Configure logging-specific client authentication for Rails.

Tail log entries

Demonstrates how to tail live log entries.

Update a sink

Demonstrates how to update a Cloud Logging Sink.

View in documentation

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.