forked from jcxplorer/cwlogger
-
Notifications
You must be signed in to change notification settings - Fork 1
/
doc.go
39 lines (39 loc) · 1.44 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Package cwlogger is a library for reliably writing logs to Amazon CloudWatch
// Logs.
//
// Features
//
// Batches log messages for efficiency by decreasing the number of API calls.
//
// Handles log stream creation based on log throughput. If too many logs are
// being written in a short period of time, the CloudWatch Logs API will return
// a ThrottlingException, which this library handles by creating an additional
// log stream every time that happens. Subsequent log writes will be distributed
// throughout all existing log streams.
//
// Handles DataAlreadyAcceptedException and InvalidSequenceTokenException errors
// by setting the log stream sequence token to the one returned by the error
// response. For InvalidSequenceTokenException, the request will be retried with
// the correct sequence token.
//
// Retries PutLogEvents API calls in case of connection failure, or temporary
// errors on CloudWatch Logs.
//
// Dependencies
//
// The only dependency for this package is the official AWS SDK for Go.
//
// Usage
//
// Use the AWS SDK for Go to configure and create the client.
//
// logger, err := cwlogger.New(&cwlogger.Config{
// LogGroupName: "groupName",
// Client: cloudwatchlogs.New(session.New())
// })
// // handle err
// logger.Log(time.Now(), "log message")
//
// For information on how to configure the AWS client, refer to the AWS
// documentation at http://docs.aws.amazon.com/sdk-for-go/api/aws/session/.
package cwlogger