-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LogStreamName is not configurable #195
Comments
Hi @Ady88w1, Thanks for opening feature request. Please refer #1 (comment). The way CloudWatch Logs is designed is each process instance needs its own stream. Thanks, |
Hi @ashishdhingra, I am aware of that, please read my original post. I am already using CloudWatch, I just wanted to migrate to NLog, or some other logging format. This library seems very opinionated about how to define log streams, which I don't really understand as it's not anywhere else, other than this. For example, I run long processes on Spot instances, when the spot instance is shut down, and resumed, I want the task to continue using the log stream it was previously using. e.g. LogStreamName: As the task is unique, there will only ever be one instance using the log stream. You resume a Log Stream but calling DescribeLogStreams and getting the current uploadSequenceToken. |
It seems it's faster to simply create a PR: #196 |
@normj I'm really unsure how you can say there is no good way to make that happen? for example (NLog): Would replicate the existing functionality, alternatively you could use any other Layout Renderer, such as guid. Considering this is supposed to be an AWS lead project, I'm unsure why you are so insistent to remove AWS CloudWatch features. |
Okay so you can in NLog have a way of make I am protective against adding this feature because it will make the performance of the library unacceptable when the This library is following the same pattern as every other AWS service that I can think of that integrates with CloudWatch Logs and has a log stream per process. |
@normj I understand your concern at this, but I think preventing a developer from using CloudWatch in the way they want to use it is not a good solution either (In my case logs of a task can be retrieved by the UI). Maybe describing the property in a way to discourage improper use would be the way forward? For example, in React you cannot set HTML directly, any HTML in a string is added to a text node to prevent cross site scripting issues. However because there are legitimate reasons why you may want to set raw HTML, there is a property called |
I'm hoping to use the EC2 Instance Id as the LogStreamName but it doesn't appear that I have the option to configure it which is really frustrating it. I can achieve the desired outcome by logging to disk and configuring the CloudWatchLogs agent to upload the logs to CloudWatch in the desired naming convention. Surely we can get a thread safe implementation of the AWSLogger provider that allows people to nominate the LogStreamName (albeit with documentation that explains the importance of not having two computers or even two applications attempting to write to the same log stream concurrently). |
Considering the recent changes to the Cloudwatch API, do the previous comments still hold true?
|
@sbol-coolblue I agree that since CloudWatch Logs has removed the requirement of sequence tokens we can add the feature to configure a specific stream. I'll try to get to this when I can. If anybody is feeling like submitting a PR to get this done quicker that would be great. Basically we need remove the sequence token logic and then add a new stream name config property. If the property name is set used that name otherwise use our existing logic for determining stream name. |
We've just released a new minor version of each package, adding a This is possible now as @sander-bol and @normj discussed above - in 2023 CloudWatch Logs removed the SequenceToken requirement. This removes the need to either split log ingestion across multiple log streams via unique stream names (the technique that this library relied upon), or else to coordinate the sequence token across multiple producers. We removed the sequence token handling entirely in this release (even when the new Let us know if you see any issues with the new setting. |
Comments on closed issues are hard for our team to see. |
Describe the feature
I'm migrating a custom logging solution using CloudWatch from the AWS SDK to NLog. This package seems to randomize the log stream name by placing a guid into the LogStream.
Use Case
Each time the executable restarts, a new log stream is created which looses the grouping and search ability you get from grouping logs into a common log stream.
Proposed Solution
Allow the LogStreamName name to be configurable, in the same way that a file name can be configurable when logging to a file.
Other Information
No response
Acknowledgements
AWS .NET SDK and/or Package version used
NLog 4.7
Targeted .NET Platform
.NET Standard
Operating System and version
Agnostic
The text was updated successfully, but these errors were encountered: