Package com.google.cloud.logging
Class Logging.WriteOption
- java.lang.Object
-
- com.google.cloud.logging.Logging.WriteOption
-
- All Implemented Interfaces:
Serializable
- Enclosing interface:
- Logging
public static final class Logging.WriteOption extends Object
Class for specifying options for writing log entries.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Logging.WriteOptionautoPopulateMetadata(boolean autoPopulateMetadata)Returns an option to opt-out automatic population of log entries metadata fields that are not set.static Logging.WriteOptiondestination(LogDestinationName destination)Returns an option to specify a log destination resource path (seeLogDestinationNamefor details)booleanequals(Object obj)inthashCode()static Logging.WriteOptionlabels(Map<String,String> labels)Sets an option to specify (key, value) pairs that are added to theLogEntry.getLabels()of each log entry written, except when a log entry already has a value associated to the same key.static Logging.WriteOptionlogName(String logName)Returns an option to specify a default log name (seeLogEntry.getLogName()) for those log entries that do not specify their own log name.static Logging.WriteOptionpartialSuccess(boolean partialSuccess)Returns an option to set partialSuccess flag.static Logging.WriteOptionresource(com.google.cloud.MonitoredResource resource)Returns an option to specify a default monitored resource (seeLogEntry.getResource()) for those log entries that do not specify their own resource.StringtoString()
-
-
-
Method Detail
-
logName
public static Logging.WriteOption logName(String logName)
Returns an option to specify a default log name (seeLogEntry.getLogName()) for those log entries that do not specify their own log name. Example:syslog.
-
resource
public static Logging.WriteOption resource(com.google.cloud.MonitoredResource resource)
Returns an option to specify a default monitored resource (seeLogEntry.getResource()) for those log entries that do not specify their own resource.
-
labels
public static Logging.WriteOption labels(Map<String,String> labels)
Sets an option to specify (key, value) pairs that are added to theLogEntry.getLabels()of each log entry written, except when a log entry already has a value associated to the same key.
-
destination
public static Logging.WriteOption destination(LogDestinationName destination)
Returns an option to specify a log destination resource path (seeLogDestinationNamefor details)
-
autoPopulateMetadata
public static Logging.WriteOption autoPopulateMetadata(boolean autoPopulateMetadata)
Returns an option to opt-out automatic population of log entries metadata fields that are not set.
-
partialSuccess
public static Logging.WriteOption partialSuccess(boolean partialSuccess)
Returns an option to set partialSuccess flag. See the API documentation for more details.
-
-