Package com.google.cloud.logging (3.20.3)

GitHub Repository

Classes

Class Description
com.google.cloud.logging.Context Class to hold context attributes including information about {@see HttpRequest} and tracing.
com.google.cloud.logging.Context.Builder A builder for {@see Context} objects.
com.google.cloud.logging.ContextHandler Class provides a per-thread storage of the {@see Context} instances.
com.google.cloud.logging.Exclusion Specifies a set of log entries that are not to be stored in Logging. If your GCP resource receives a large volume of logs, you can use exclusions to reduce your chargeable logs. Exclusions are processed after log sinks, so you can export log entries before they are excluded. Note that organization-level and folder-level exclusions don't apply to child resources, and that
com.google.cloud.logging.Exclusion.Builder A builder for Exclusion objects.
com.google.cloud.logging.HttpRequest Objects of this class represent information about the (optional) HTTP request associated with a log entry. See Also: Http Request
com.google.cloud.logging.HttpRequest.Builder A builder for HttpRequest objects.
com.google.cloud.logging.HttpRequest.RequestMethod The HTTP request method.
com.google.cloud.logging.Instrumentation
com.google.cloud.logging.LogDestinationName Class for specifying resource name of the log to which this log entry belongs (see 'logName' parameter in https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry)
com.google.cloud.logging.LogEntry A Cloud Logging log entry. All log entries are represented via objects of this class. Log entries can have different type of payloads: an UTF-8 string (see Payload.StringPayload), a JSON object (see Payload.JsonPayload, or a protobuf object (see Payload.ProtoPayload). Entries can also store additional information about the operation or the HTTP request that
com.google.cloud.logging.LogEntry.Builder A builder for LogEntry objects.
com.google.cloud.logging.LogEntryIterator The class implements {@see Iterator} interface over {@see LogEntry} by iterating through {@see TailLogEntriesResponse} streamed by BidiStream. This class is instantiated by {@see LogEntryServerStream} and is not intended to be used explicitly.
com.google.cloud.logging.LogEntryServerStream The class implements Iterable interface over {@see LogEntry}. It wraps around BidiStream bi-directional gRPC stream to support iterating through ingested responses. The class uses {@see LogEntryIterator} to iterate through the processed responses. The stream should be explicitly canceled by calling {@see LogEntryServerStream#cancel()} method. The class does not provide recovery or resuming functionality over the stream.
com.google.cloud.logging.Logging.EntryListOption Class for specifying options for listing log entries.
com.google.cloud.logging.Logging.ListOption Class for specifying options for listing sinks, monitored resources and monitored resource descriptors.
com.google.cloud.logging.Logging.TailOption Class for specifying options for tailing log entries.
com.google.cloud.logging.Logging.WriteOption Class for specifying options for writing log entries.
com.google.cloud.logging.LoggingHandler A logging handler that outputs logs generated with java.util.logging.Logger to Cloud Logging.

Java logging levels (see java.util.logging.Level) are mapped to the following Google

com.google.cloud.logging.LoggingLevel This class adds some additional Java logging levels for Cloud Logging. Added levels fill in the gap between Java logging levels and Cloud Logging severities.

Added levels in descending order are (between parenthesis the relation with Java logging

com.google.cloud.logging.LoggingOptions
com.google.cloud.logging.LoggingOptions.Builder
com.google.cloud.logging.LoggingOptions.DefaultLoggingFactory
com.google.cloud.logging.LoggingOptions.DefaultLoggingRpcFactory
com.google.cloud.logging.MetadataLoader
com.google.cloud.logging.Metric Cloud Logging metrics describe logs-based metric. The value of the metric is the number of log entries that match a logs filter (see #getFilter()).

Metric adds a layer of service-related functionality over MetricInfo. Objects

com.google.cloud.logging.Metric.Builder A builder for Metric objects.
com.google.cloud.logging.MetricInfo Cloud Logging metrics describe logs-based metric. The value of the metric is the number of log entries that match a logs filter (see #getFilter()). See Also: Logs-based Metrics
com.google.cloud.logging.MetricInfo.Builder A builder for MetricInfo objects.
com.google.cloud.logging.MonitoredResourceUtil Monitored resource construction utilities to detect resource type and add labels. Used by logging framework adapters to configure default resource. See usage in LoggingHandler.
com.google.cloud.logging.Operation Additional information about a potentially long-running operation with which a log entry is associated. See Also: Log Entry Operation
com.google.cloud.logging.Operation.Builder A builder for Operation objects.
com.google.cloud.logging.Payload A base class for log entry payloads. See Also: Log Entries and Logs
com.google.cloud.logging.Payload.JsonPayload A log entry's JSON payload.
com.google.cloud.logging.Payload.ProtoPayload A log entry payload as a protobuf object.
com.google.cloud.logging.Payload.StringPayload A log entry payload as an UTF-8 string.
com.google.cloud.logging.Sink Cloud Logging sinks can be used to control the export of your logs. Each sink specifies the export of a set of log entries to a certain destination. A sink consists of a name, unique to the project, a filter for choosing the log entries to export and a destination for the log entries.
com.google.cloud.logging.Sink.Builder A builder for Sink objects.
com.google.cloud.logging.SinkInfo Cloud Logging sinks can be used to control the export of your logs. Each sink specifies the export of a set of log entries to a certain destination. A sink consists of a name, unique to the project, a filter for choosing the log entries to export and a destination for the log entries.
com.google.cloud.logging.SinkInfo.Builder A builder for SinkInfo objects.
com.google.cloud.logging.SinkInfo.Destination
com.google.cloud.logging.SinkInfo.Destination.BucketDestination Class for specifying a Google Cloud Storage bucket as destination for the sink.
com.google.cloud.logging.SinkInfo.Destination.DatasetDestination Class for specifying a Google Cloud BigQuery dataset as destination for the sink.
com.google.cloud.logging.SinkInfo.Destination.LoggingBucketDestination
com.google.cloud.logging.SinkInfo.Destination.TopicDestination Class for specifying a Google Cloud BigQuery dataset as destination for the sink.
com.google.cloud.logging.SourceLocation Additional information about the source code location that produced the log entry.
com.google.cloud.logging.SourceLocation.Builder A builder for SourceLocation objects.
com.google.cloud.logging.TimestampDefaultFilter
com.google.cloud.logging.TraceLoggingEnhancer

Interfaces

Interface Description
com.google.cloud.logging.ITimestampDefaultFilter Encapsulates implementation of default time filter. This is needed for testing since we can't mock static classes with EasyMock
com.google.cloud.logging.Logging
com.google.cloud.logging.LoggingEnhancer An enhancer for log entries. Used to add custom labels to the LogEntry.Builder
com.google.cloud.logging.LoggingFactory An interface for Logging factories.
com.google.cloud.logging.ResourceTypeEnvironmentGetter

Enums

Enum Description
com.google.cloud.logging.ContextHandler.ContextPriority
com.google.cloud.logging.LogDestinationName.DestinationType
com.google.cloud.logging.Logging.SortingField Fields according to which log entries can be sorted.
com.google.cloud.logging.Logging.SortingOrder Sorting orders available when listing log entries.
com.google.cloud.logging.LoggingHandler.LogTarget Where to send logs.
com.google.cloud.logging.MonitoredResourceUtil.Label
com.google.cloud.logging.Payload.Type Type for a log entry payload.
com.google.cloud.logging.Severity The severity of the event described in a log entry. These guideline severity levels are ordered, with numerically smaller levels treated as less severe than numerically larger levels. If the source of the log entries uses a different set of severity levels, the client should select the closest corresponding Severity value.
com.google.cloud.logging.SinkInfo.Destination.Type Type of destination for Cloud Logging sink.
com.google.cloud.logging.SinkInfo.VersionFormat Available log entry formats. Log entries can be written to Cloud Logging in either format and can be exported in either format. Version 2 is the preferred format.
com.google.cloud.logging.Synchronicity Used to specify the behavior of write calls to the Cloud Logging service. Specifying SYNC will make synchronous calls; specifying ASYNC will make asynchronous calls. The default behavior is ASYNC.

Exceptions

Exception Description
com.google.cloud.logging.LoggingException Logging service exception.