CloudWatchHandler class

A CloudWatch handler class to easily manage multiple CloudWatch instances

Constructors

CloudWatchHandler({required dynamic awsAccessKey, required dynamic awsSecretKey, required dynamic region, String? awsSessionToken, Duration delay = const Duration(milliseconds: 200), Duration requestTimeout = const Duration(seconds: 10), bool useDynamicTimeout = true, double timeoutMultiplier = 1.2, Duration dynamicTimeoutMax = const Duration(minutes: 2), dynamic retries = 3, CloudWatchLargeMessages largeMessageBehavior = CloudWatchLargeMessages.split, bool raiseFailedLookups = false, int maxBytesPerMessage = awsMaxBytesPerMessage, int maxBytesPerRequest = awsMaxBytesPerRequest, int maxMessagesPerRequest = awsMaxMessagesPerRequest})
CloudWatchHandler Constructor

Properties

awsAccessKey String
Your AWS access key
getter/setter pair
awsSecretKey String
Your AWS secret key
getter/setter pair
awsSessionToken String?
Your AWS session token
getter/setter pair
delay Duration
How long to wait between requests to avoid rate limiting (suggested value is Duration(milliseconds: 200))
getter/setter pair
dynamicTimeoutMax Duration
The maximum length dynamic timeouts can be
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
largeMessageBehavior CloudWatchLargeMessages
How messages larger than AWS limit should be handled. Default is truncate.
getter/setter pair
maxBytesPerMessage int
Changes how large each message can be before largeMessageBehavior takes effect. Min 5, Max 262116
getter/setter pair
maxBytesPerRequest int
Changes how many bytes can be sent in each API request before a second request is made. Min 1, Max 1048576
getter/setter pair
maxMessagesPerRequest int
Changes the maximum number of messages that can be sent in each API request. Min 1, Max 10000
getter/setter pair
raiseFailedLookups bool
Whether exceptions should be raised on failed lookups (usually no internet)
getter/setter pair
region String
Your AWS region. Instances are not updated when this value is changed
getter/setter pair
requestTimeout Duration
How long to wait for request before triggering a timeout
getter/setter pair
retries int
How many times an api request should be retired upon failure. Default is 3
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeoutMultiplier double
How much to increase the timeout after a timeout occurs
getter/setter pair
useDynamicTimeout bool
Whether to dynamically adjust the timeout or not
getter/setter pair

Methods

createInstance({required String logGroupName, required String logStreamName}) CloudWatch
Creates a CloudWatch instance.
getInstance({required String logGroupName, required String logStreamName}) CloudWatch?
Returns a specific instance of a CloudWatch class (or null if it doesn't exist) based on group name and stream name
log({required String message, required String logGroupName, required String logStreamName}) Future<void>
Logs the provided message to the provided log group and log stream
logMany({required List<String> messages, required String logGroupName, required String logStreamName}) Future<void>
Logs the provided message to the provided log group and log stream
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited