Prevent monitor from not starting when LogStreamName already exists #257
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to issue #244
Description of issue was replied against main issue #244 (comment)
Description of changes:
With the recent addition of a
LogStreamName
configuration to allow overriding the generated stream name, it was overlooked that the library will throw an exception if that LogStreamName already exists, defeating the purpose of that added feature.In addition, with the recent CloudWatch improvement of "removing the requirement of providing a sequence token when calling Amazon CloudWatch Logs PutLogEvents API", which this library has implemented, it's probably a good idea to not throw an exeption and crash the monitor if the
LogStreamName
already exists for any configuration. However for backwards compatibility, a library log will still get logged if that's the case beyondLogStreamName
.Setting a
LogStreamName
is unusuable after the first run of the logger, hence this PR.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.