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
public static final class Sink.Builder extends SinkInfo.Builder
A builder forSinkobjects.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Sinkbuild()Creates aSinkInfoobject for this builder.Sink.BuildersetDestination(SinkInfo.Destination destination)Sets the export destination.Sink.BuildersetFilter(String filter)Sets an advanced logs filter.Sink.BuildersetName(String name)Sets the name of the sink.Sink.BuildersetVersionFormat(SinkInfo.VersionFormat versionFormat)Sets the log entry version to use for this sink's exported log entries.
-
-
-
Method Detail
-
setName
@CanIgnoreReturnValue public Sink.Builder setName(String name)
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
@CanIgnoreReturnValue public Sink.Builder setDestination(SinkInfo.Destination destination)
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:
- Exporting Logs
-
setFilter
@CanIgnoreReturnValue public Sink.Builder setFilter(String filter)
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:
- Advanced Log Filters
-
setVersionFormat
@CanIgnoreReturnValue public Sink.Builder setVersionFormat(SinkInfo.VersionFormat versionFormat)
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
public Sink build()
Description copied from class:SinkInfo.BuilderCreates aSinkInfoobject for this builder.- Specified by:
buildin classSinkInfo.Builder
-
-