cwlogger | Go library for reliably writing logs | AWS library
kandi X-RAY | cwlogger Summary
kandi X-RAY | cwlogger Summary
A Go library for easily and reliably writing logs to Amazon CloudWatch Logs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- New returns a new Logger .
- newLogStreams creates a new logStreams
- Log implements Logger .
- newBatcher returns a new batcher .
- shouldRetry returns whether the given error is a retryable error .
- isErrorCode returns true if err is an Error with the given code .
- newBatch returns a new batch .
- randomHex returns a random string
- noopErrorReporter is a noopErrorReporter .
cwlogger Key Features
cwlogger Examples and Code Snippets
Community Discussions
Trending Discussions on cwlogger
QUESTION
I am trying to achieve following using my program: Create log-group on aws cloudwatch Create log-stream under above log-group Put log-events under above log-stream
All this using go lang
...ANSWER
Answered 2019-Mar-18 at 01:07Reason for SerializationException was:logevents := make([]*cloudwatchlogs.InputLogEvent, 1)
followed by append which created first empty entry in slice. I replaced code with
logevents := make([]*cloudwatchlogs.InputLogEvent, 0)
and it got resolved.
Additionally while debugging to find why logs were not getting populated I figured out that timestamp value used is not valid one. According to aws documentation timestamp for each event can't be older than 14 days and can't be more than 2hr in future. Here is link: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html
Hope it will be helpful to someone facing similar issue in future.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cwlogger
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page