Options for configuring the CloudWatch Logs sink.
client: CloudWatchLogsClient
An existing CloudWatch Logs client instance. If provided, the client will be used directly and other connection options (region, credentials) will be ignored.
logGroupName: string
The name of the log group to send log events to.
logStreamName: string
The name of the log stream within the log group.
The AWS region to use when creating a new client.
Ignored if client
is provided.
credentials: { readonly accessKeyId: string; readonly secretAccessKey: string; readonly sessionToken?: string; }
AWS credentials to use when creating a new client.
Ignored if client
is provided.
If not provided, the AWS SDK will use default credential resolution.
Maximum number of log events to batch before sending to CloudWatch. Must be between 1 and 10,000.
flushInterval: number
Maximum time in milliseconds to wait before flushing buffered log events. Set to 0 or negative to disable time-based flushing.
maxRetries: number
Maximum number of retry attempts for failed requests.
retryDelay: number
Initial delay in milliseconds for exponential backoff retry strategy.
formatter: TextFormatter
Text formatter to use for formatting log records before sending to CloudWatch Logs.
If not provided, defaults to a simple text formatter.
Use jsonLinesFormatter()
from "@logtape/logtape" for JSON structured logging
to enable powerful CloudWatch Logs Insights querying capabilities.