Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBatchIntervalTooSmall = errors.New("supplied batch interval is less than the minimum")
Functions ¶
This section is empty.
Types ¶
type CloudWatchLogsClient ¶
type CloudWatchLogsClient interface { DescribeLogStreams(context.Context, *cloudwatchlogs.DescribeLogStreamsInput, ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.DescribeLogStreamsOutput, error) CreateLogGroup(context.Context, *cloudwatchlogs.CreateLogGroupInput, ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.CreateLogGroupOutput, error) CreateLogStream(context.Context, *cloudwatchlogs.CreateLogStreamInput, ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.CreateLogStreamOutput, error) PutLogEvents(context.Context, *cloudwatchlogs.PutLogEventsInput, ...func(*cloudwatchlogs.Options)) (*cloudwatchlogs.PutLogEventsOutput, error) }
CloudWatchLogsClient represents the AWS cloudwatchlogs client that we need to talk to CloudWatch
type CloudWatchWriter ¶
CloudWatchWriter can be inserted into zerolog to send logs to CloudWatch.
func NewWithClient ¶
func NewWithClient(client CloudWatchLogsClient, batchInterval time.Duration, logGroupName, logStreamName string) (*CloudWatchWriter, error)
NewWithClient returns a pointer to a CloudWatchWriter struct, or an error. Works with AWS SDK v1 interface.
func (*CloudWatchWriter) Close ¶
func (c *CloudWatchWriter) Close()
Close blocks until the writer has completed writing the logs to CloudWatch.
func (*CloudWatchWriter) SetBatchInterval ¶
func (c *CloudWatchWriter) SetBatchInterval(interval time.Duration) error
SetBatchInterval sets the maximum time between batches of logs sent to CloudWatch.
Click to show internal directories.
Click to hide internal directories.