-
Notifications
You must be signed in to change notification settings - Fork 950
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
enhance: add new formatter for syslog #1608
enhance: add new formatter for syslog #1608
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1608 +/- ##
==========================================
- Coverage 41.99% 41.99% -0.01%
==========================================
Files 270 270
Lines 17597 17607 +10
==========================================
+ Hits 7390 7394 +4
- Misses 9298 9304 +6
Partials 909 909
|
daemon/logger/syslog/fmt.go
Outdated
@@ -17,9 +17,9 @@ func rfc5424FormatterWithTagAsAppName(p srslog.Priority, hostname, tag, content | |||
} | |||
|
|||
func rfc5424MicroFormatterWithTagAsAppName(p srslog.Priority, hostname, tag, content string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does rfc5424FormatterWithTagAsAppName need to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is WIP for check. I will close it.
Reuse this branch @shaloulcy sorry for that |
Update the code and comment. Please take a look @shaloulcy |
ping @fuweid |
A lot of log collectors consumes log data and indexs it by the timestamp in millisecond format. In order to make the collector to consume data in the order, we need to add the sequence number in the log. Simplify the case, PouchContainer will uses the nano timestamp as sequene number. Signed-off-by: Wei Fu <fhfuwei@163.com>
LGTM |
@fuweid please rebase your code~ |
I have rebased my code with latest upstream... |
Ⅰ. Describe what this PR did
A lot of log collectors consumes log data and indexs it by the timestamp in millisecond format. In order to make the collector to consume data in the order, we need to add the sequence number in the log. Simplify the case, PouchContainer will uses the nano timestamp as sequene number.
Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. Describe how you did it
Add one more syslog formatter
Ⅳ. Describe how to verify it
First, we should follow the
/var/log/syslog
and runpouch run --log-driver syslog --log-opt syslog-format=rfc5424micro-seq --log-opt tag={{.DaemonName}} busybox echo hi
.We will got the message in the syslog like:
Ⅴ. Special notes for reviews