public interface Logging extends AutoCloseable, Service<LoggingOptions>
| Modifier and Type | Interface and Description |
|---|---|
static class |
Logging.EntryListOption
Class for specifying options for listing log entries.
|
static class |
Logging.ListOption
Class for specifying options for listing sinks, monitored resources and monitored resource
descriptors.
|
static class |
Logging.SortingField
Fields according to which log entries can be sorted.
|
static class |
Logging.SortingOrder
Sorting orders available when listing log entries.
|
static class |
Logging.WriteOption
Class for specifying options for writing log entries.
|
| Modifier and Type | Method and Description |
|---|---|
Metric |
create(MetricInfo metric)
Creates a new metric.
|
Sink |
create(SinkInfo sink)
Creates a new sink.
|
Future<Metric> |
createAsync(MetricInfo metric)
Sends a request for creating a metric.
|
Future<Sink> |
createAsync(SinkInfo sink)
Sends a request for creating a sink.
|
boolean |
deleteLog(String log)
Deletes a log and all its log entries.
|
Future<Boolean> |
deleteLogAsync(String log)
Sends a request for deleting a log and all its log entries.
|
boolean |
deleteMetric(String metric)
Deletes the requested metric.
|
Future<Boolean> |
deleteMetricAsync(String metric)
Sends a request for deleting a metric.
|
boolean |
deleteSink(String sink)
Deletes the requested sink.
|
Future<Boolean> |
deleteSinkAsync(String sink)
Sends a request for deleting a sink.
|
Metric |
getMetric(String metric)
Returns the requested metric or
null if not found. |
Future<Metric> |
getMetricAsync(String metric)
Sends a request for getting a metric.
|
Sink |
getSink(String sink)
Returns the requested sink or
null if not found. |
Future<Sink> |
getSinkAsync(String sink)
Sends a request for getting a sink.
|
Page<LogEntry> |
listLogEntries(Logging.EntryListOption... options)
Lists log entries.
|
Future<AsyncPage<LogEntry>> |
listLogEntriesAsync(Logging.EntryListOption... options)
Sends a request for listing log entries.
|
Page<Metric> |
listMetrics(Logging.ListOption... options)
Lists the metrics.
|
Future<AsyncPage<Metric>> |
listMetricsAsync(Logging.ListOption... options)
Sends a request for listing metrics.
|
Page<MonitoredResourceDescriptor> |
listMonitoredResourceDescriptors(Logging.ListOption... options)
Lists the monitored resource descriptors used by Stackdriver Logging.
|
Future<AsyncPage<MonitoredResourceDescriptor>> |
listMonitoredResourceDescriptorsAsync(Logging.ListOption... options)
Sends a request for listing monitored resource descriptors used by Stackdriver Logging.
|
Page<Sink> |
listSinks(Logging.ListOption... options)
Lists the sinks.
|
Future<AsyncPage<Sink>> |
listSinksAsync(Logging.ListOption... options)
Sends a request for listing sinks.
|
Metric |
update(MetricInfo metric)
Updates a metric or creates one if it does not exist.
|
Sink |
update(SinkInfo sink)
Updates a sink or creates one if it does not exist.
|
Future<Metric> |
updateAsync(MetricInfo metric)
Sends a request for updating a metric (or creating it, if it does not exist).
|
Future<Sink> |
updateAsync(SinkInfo sink)
Sends a request for updating a sink (or creating it, if it does not exist).
|
void |
write(Iterable<LogEntry> logEntries,
Logging.WriteOption... options)
Writes log entries to Stackdriver Logging.
|
Future<Void> |
writeAsync(Iterable<LogEntry> logEntries,
Logging.WriteOption... options)
Sends a request to log entries to Stackdriver Logging.
|
closeSink create(SinkInfo sink)
LoggingException - upon failureFuture<Sink> createAsync(SinkInfo sink)
Future object to consume the
result. Future.get() returns the created sink.Sink update(SinkInfo sink)
LoggingException - upon failureFuture<Sink> updateAsync(SinkInfo sink)
Future object to consume the result. Future.get() returns the
updated/created sink or null if not found.Sink getSink(String sink)
null if not found.LoggingException - upon failureFuture<Sink> getSinkAsync(String sink)
Future object to consume the
result. Future.get() returns the requested sink or null if not found.LoggingException - upon failurePage<Sink> listSinks(Logging.ListOption... options)
Page object that can be used to consume
paginated results. Use Logging.ListOption to specify the page size or the page token from which
to start listing sinks.LoggingException - upon failureFuture<AsyncPage<Sink>> listSinksAsync(Logging.ListOption... options)
Future object to consume
the result. Future.get() returns an AsyncPage object that can be used to
asynchronously handle paginated results. Use Logging.ListOption to specify the page size or the
page token from which to start listing sinks.boolean deleteSink(String sink)
true if the sink was deleted, false if it was not foundFuture<Boolean> deleteSinkAsync(String sink)
Future object to consume the
result. Future.get() returns true if the sink was deleted, false if it
was not found.boolean deleteLog(String log)
true if the log was deleted, false if it was not foundFuture<Boolean> deleteLogAsync(String log)
Future object to consume the result. Future.get() returns true if the
log was deleted, false if it was not found.Page<MonitoredResourceDescriptor> listMonitoredResourceDescriptors(Logging.ListOption... options)
Page object that can be used to consume paginated results. Use Logging.ListOption to
specify the page size or the page token from which to start listing resource descriptors.LoggingException - upon failureFuture<AsyncPage<MonitoredResourceDescriptor>> listMonitoredResourceDescriptorsAsync(Logging.ListOption... options)
Future object to consume the result. Future.get() returns an
AsyncPage object that can be used to asynchronously handle paginated results. Use
Logging.ListOption to specify the page size or the page token from which to start listing
resource descriptors.Metric create(MetricInfo metric)
LoggingException - upon failureFuture<Metric> createAsync(MetricInfo metric)
Future object to consume
the result. Future.get() returns the created metric.Metric update(MetricInfo metric)
LoggingException - upon failureFuture<Metric> updateAsync(MetricInfo metric)
Future object to consume the result. Future.get() returns the
updated/created metric or null if not found.Metric getMetric(String metric)
null if not found.LoggingException - upon failureFuture<Metric> getMetricAsync(String metric)
Future object to consume
the result. Future.get() returns the requested metric or null if not found.LoggingException - upon failurePage<Metric> listMetrics(Logging.ListOption... options)
Page object that can be used to consume
paginated results. Use Logging.ListOption to specify the page size or the page token from which
to start listing metrics.LoggingException - upon failureFuture<AsyncPage<Metric>> listMetricsAsync(Logging.ListOption... options)
Future object to consume
the result. Future.get() returns an AsyncPage object that can be used to
asynchronously handle paginated results. Use Logging.ListOption to specify the page size or the
page token from which to start listing metrics.boolean deleteMetric(String metric)
true if the metric was deleted, false if it was not foundFuture<Boolean> deleteMetricAsync(String metric)
Future object to consume
the result. Future.get() returns true if the metric was deleted, false
if it was not found.void write(Iterable<LogEntry> logEntries, Logging.WriteOption... options)
Logging.WriteOption.logName(String) to provide a
log name for those entries that do not specify one. Use
Logging.WriteOption.resource(MonitoredResource) to provide a monitored resource for those
entries that do not specify one. Use Logging.WriteOption.labels(Map) to provide some labels
to be added to every entry in logEntries.Future<Void> writeAsync(Iterable<LogEntry> logEntries, Logging.WriteOption... options)
Logging.WriteOption.logName(String)
to provide a log name for those entries that do not specify one. Use
Logging.WriteOption.resource(MonitoredResource) to provide a monitored resource for those
entries that do not specify one. Use Logging.WriteOption.labels(Map) to provide some labels
to be added to every entry in logEntries. The method returns a Future object
that can be used to wait for the write operation to be completed.Page<LogEntry> listLogEntries(Logging.EntryListOption... options)
Page object that can be used to consume
paginated results. Use Logging.EntryListOption.pageSize(int) to specify the page size. Use
Logging.EntryListOption.pageToken(String) to specify the page token from which to start listing
entries. Use EntryListOption#sortOrder(SortingField, SortingOrder) to sort log entries
according to your preferred order (default is most-recent last). Use
Logging.EntryListOption.filter(String) to filter listed log entries.LoggingException - upon failureFuture<AsyncPage<LogEntry>> listLogEntriesAsync(Logging.EntryListOption... options)
Future object to consume
the result. Future.get() returns an AsyncPage object that can be used to
asynchronously handle paginated results. Use Logging.EntryListOption.pageSize(int) to specify
the page size. Use Logging.EntryListOption.pageToken(String) to specify the page token from
which to start listing entries. Use
EntryListOption#sortOrder(SortingField, SortingOrder) to sort log entries according to
your preferred order (default is most-recent last). Use Logging.EntryListOption.filter(String)
to filter listed log entries.LoggingException - upon failureCopyright © 2016 Google. All rights reserved.