Skip navigation links

@Generated(value="by gapic-generator")

Package com.google.cloud.logging.v2

A client to Stackdriver Logging API.

See: Description

Package com.google.cloud.logging.v2 Description

A client to Stackdriver Logging API.

The interfaces provided are listed below, along with usage samples.

============ ConfigClient ============

Service Description: Service for configuring sinks used to route log entries.

Sample for ConfigClient:

 
 try (ConfigClient configClient = ConfigClient.create()) {
   SinkName sinkName = ProjectSinkName.of("[PROJECT]", "[SINK]");
   LogSink response = configClient.getSink(sinkName);
 }
 
 
============= LoggingClient =============

Service Description: Service for ingesting and querying logs.

Sample for LoggingClient:

 
 try (LoggingClient loggingClient = LoggingClient.create()) {
   LogName logName = ProjectLogName.of("[PROJECT]", "[LOG]");
   loggingClient.deleteLog(logName);
 }
 
 
============= MetricsClient =============

Service Description: Service for configuring logs-based metrics.

Sample for MetricsClient:

 
 try (MetricsClient metricsClient = MetricsClient.create()) {
   MetricName metricName = ProjectMetricName.of("[PROJECT]", "[METRIC]");
   LogMetric response = metricsClient.getLogMetric(metricName);
 }
 
 
Skip navigation links

Copyright © 2019 Google LLC. All rights reserved.