Skip navigation links

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.

============= LoggingClient =============

Service Description: Service for ingesting and querying logs.

Sample for LoggingClient:

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

Service Description: Service for configuring sinks used to export log entries outside of Stackdriver Logging.

Sample for ConfigClient:

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

Service Description: Service for configuring logs-based metrics.

Sample for MetricsClient:

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

Copyright © 2017 Google. All rights reserved.