-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
Watchtower fails to log empty line (since Cloudwatch rejects them) #154
Comments
Hey @kislyuk |
Hello, thank you for reporting this issue. I have implemented a solution in #158 and will be releasing it as v2.0.0. The solution is to never send empty messages to CloudWatch Logs and to print a warning when this happens. |
Awesome, so basically the third proposal. Glad to hear it's already in place. What is the timeline for the release of 2.0.0 @kislyuk? Let me know if I can help with anything to speed that up (testing, remaining dev tasks, etc). Cheers |
@o-nikolas v2.0.0 has been released. |
It appears the closed issue #43 is still present. I took some time today to investigate and try some fixes:
Given this example logging code:
Upon execution with current Watchtower I see:
The cloudwatch local validation fails and the whole batch of messages are not delivered to cloudwatch logs.
I've wrote a new Filter and tested some approaches.
Replaces empty messages with newline
The error case is no longer hit, but since the record is modified to now contain a newline rather than empty string, both the downstream loggers and cloudwatch logs show an extra newline:
Also the cloudwatch logging text itself contains a new line, so when it is downloaded the formatting is a bit odd (CSV format):
Replace empty message with space
The error case is no longer hit, but since the record is modified to now contain a whitespace rather than empty string, downstream loggers and Cloudwatch contain en extra space, but this is less noticeable than an extra newline IMHO:
(Note you can highlight the line to see the errant whitespace)
Cloudwatch CSV:
Filter empty messages entirely
The error case is no longer hit. Since this does not modify the record only the cloudwatch logs are affected. So the CW logs do not have the same formatting, but other downstream loggers show the correct logging:
Cloudwatch CSV, note the missing empty line:
@kislyuk do you have a preference for which approach we take? Shall we make it configurable? Is there another approach that I haven't listed that you think is better?
The text was updated successfully, but these errors were encountered: