Package com.google.cloud.logging
Class Sink.Builder
java.lang.Object
com.google.cloud.logging.SinkInfo.Builder
com.google.cloud.logging.Sink.Builder
- Enclosing class:
- Sink
A builder for
Sink objects.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aSinkInfoobject for this builder.setDestination(SinkInfo.Destination destination) Sets the export destination.Sets an advanced logs filter.Sets the name of the sink.setVersionFormat(SinkInfo.VersionFormat versionFormat) Sets the log entry version to use for this sink's exported log entries.
-
Method Details
-
setName
Description copied from class:SinkInfo.BuilderSets the name of the sink. Example:my-severe-errors-to-pubsub. Sink identifiers are limited to 1000 characters and can include only the following characters:A-Z,a-z,0-9, and the special characters_-..- Specified by:
setNamein classSinkInfo.Builder
-
setDestination
Description copied from class:SinkInfo.BuilderSets the export destination. Use aSinkInfo.Destination.BucketDestinationobject to create a sink that exports logs to a Google Cloud Storage bucket. Use aSinkInfo.Destination.DatasetDestinationobject to create a sink that exports logs to a Google Cloud BigQuery dataset. Use aSinkInfo.Destination.TopicDestinationobject to create a sink that exports logs to a Google Cloud Pub/Sub topic.- Specified by:
setDestinationin classSinkInfo.Builder- See Also:
-
setFilter
Description copied from class:SinkInfo.BuilderSets an advanced logs filter. Only log entries matching that filter are exported. The filter must be consistent with the log entry format specified withSinkInfo.Builder.setVersionFormat(VersionFormat), regardless of the format of the log entry that was originally written to Cloud Logging. Example (V2 format):logName=projects/my-projectid/logs/syslog AND severity>=ERROR.- Specified by:
setFilterin classSinkInfo.Builder- See Also:
-
setVersionFormat
Description copied from class:SinkInfo.BuilderSets the log entry version to use for this sink's exported log entries. This version does not have to correspond to the version of the log entry when it was written to Google Cloud Logging.- Specified by:
setVersionFormatin classSinkInfo.Builder
-
build
Description copied from class:SinkInfo.BuilderCreates aSinkInfoobject for this builder.- Specified by:
buildin classSinkInfo.Builder
-