Record Class CloudWatchLogClientOptions

java.lang.Object
java.lang.Record
codes.grow.packages.cloudwatchlogs.CloudWatchLogClientOptions
Record Components:
group - log group (null: config.logGroup, required)
stream - log stream (null: config.logStream; created on first use)
createGroup - create a missing log group on the first export (default false)
batchOptions - batching options (null: BatchOptions.defaults())
resource - resource attributes (service.name, …) added to every record
redaction - redaction applied before records leave the process (null: defaults)

public record CloudWatchLogClientOptions(String group, String stream, boolean createGroup, BatchOptions batchOptions, Map<String,Object> resource, RedactionProcessor redaction) extends Record
Options of CloudWatchLogsClient.logClient.
  • Constructor Details

    • CloudWatchLogClientOptions

      public CloudWatchLogClientOptions(String group, String stream, boolean createGroup, BatchOptions batchOptions, Map<String,Object> resource, RedactionProcessor redaction)
      Applies defaults.
      Parameters:
      group - group
      stream - stream
      createGroup - create the group
      batchOptions - batching options
      resource - resource attributes
      redaction - redaction
  • Method Details

    • defaults

      public static CloudWatchLogClientOptions defaults()
      Options with every default.
      Returns:
      the options
    • withTarget

      public CloudWatchLogClientOptions withTarget(String groupName, String streamName)
      Returns a copy with another group and stream.
      Parameters:
      groupName - group (null: default)
      streamName - stream (null: default)
      Returns:
      the copy
    • withCreateGroup

      public CloudWatchLogClientOptions withCreateGroup(boolean value)
      Returns a copy that creates a missing group.
      Parameters:
      value - flag
      Returns:
      the copy
    • withBatchOptions

      public CloudWatchLogClientOptions withBatchOptions(BatchOptions value)
      Returns a copy with other batching options.
      Parameters:
      value - options
      Returns:
      the copy
    • withResource

      public CloudWatchLogClientOptions withResource(Map<String,Object> value)
      Returns a copy with other resource attributes.
      Parameters:
      value - attributes
      Returns:
      the copy
    • withRedaction

      public CloudWatchLogClientOptions withRedaction(RedactionProcessor value)
      Returns a copy with another redaction processor.
      Parameters:
      value - processor
      Returns:
      the copy
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • group

      public String group()
      Returns the value of the group record component.
      Returns:
      the value of the group record component
    • stream

      public String stream()
      Returns the value of the stream record component.
      Returns:
      the value of the stream record component
    • createGroup

      public boolean createGroup()
      Returns the value of the createGroup record component.
      Returns:
      the value of the createGroup record component
    • batchOptions

      public BatchOptions batchOptions()
      Returns the value of the batchOptions record component.
      Returns:
      the value of the batchOptions record component
    • resource

      public Map<String,Object> resource()
      Returns the value of the resource record component.
      Returns:
      the value of the resource record component
    • redaction

      public RedactionProcessor redaction()
      Returns the value of the redaction record component.
      Returns:
      the value of the redaction record component