Package com.google.cloud.logging
Class SinkInfo.Builder
- java.lang.Object
-
- com.google.cloud.logging.SinkInfo.Builder
-
- Direct Known Subclasses:
Sink.Builder
- Enclosing class:
- SinkInfo
public abstract static class SinkInfo.Builder extends Object
A builder forSinkInfoobjects.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract SinkInfobuild()Creates aSinkInfoobject for this builder.abstract SinkInfo.BuildersetDestination(SinkInfo.Destination destination)Sets the export destination.abstract SinkInfo.BuildersetFilter(String filter)Sets an advanced logs filter.abstract SinkInfo.BuildersetName(String name)Sets the name of the sink.abstract SinkInfo.BuildersetVersionFormat(SinkInfo.VersionFormat versionFormat)Sets the log entry version to use for this sink's exported log entries.
-
-
-
Method Detail
-
setName
public abstract SinkInfo.Builder setName(String name)
Sets 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_-..
-
setDestination
public abstract SinkInfo.Builder setDestination(SinkInfo.Destination destination)
Sets 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.- See Also:
- Exporting Logs
-
setFilter
public abstract SinkInfo.Builder setFilter(String filter)
Sets an advanced logs filter. Only log entries matching that filter are exported. The filter must be consistent with the log entry format specified withsetVersionFormat(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.- See Also:
- Advanced Log Filters
-
setVersionFormat
public abstract SinkInfo.Builder setVersionFormat(SinkInfo.VersionFormat versionFormat)
Sets 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.
-
build
public abstract SinkInfo build()
Creates aSinkInfoobject for this builder.
-
-