aws / aws-logging-dotnet

.NET Libraries for integrating Amazon CloudWatch Logs with popular .NET logging libraries
Apache License 2.0
299 stars 133 forks source link

Releasing LogStreamName #244

Closed ashovlin closed 7 months ago

ashovlin commented 7 months ago

Issue #, if available: N/A

Description of changes: Releasing #242

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

michaeldimoudis commented 6 months ago

Hi @ashovlin and @philasmar I'm wondering whether there is some technical limitation, or if it was an oversight that a new LogStreamName is required each time the app is started/logger created?

When using LogStreamName, the library will only work if the LogStreamName is not already created. However once the LogStreamName is already created, ie: when the app starts up again, no logs will be ingested due to the error Amazon.CloudWatchLogs.Model.ResourceAlreadyExistsException: The specified log stream already exists ---> Amazon.Runtime.Internal.HttpErrorResponseException: The remote server returned an error: (400) Bad Request.

I can help with a PR for this, but I wanted to touch base first.

Log stream creation is at https://github.com/aws/aws-logging-dotnet/blob/master/src/AWS.Logger.Core/Core/AWSLoggerCore.cs#L450-458

normj commented 6 months ago

@michaeldimoudis This was an oversight. Your PR looks good and I'll make sure we get it released quickly.