This fix tries to address the issue raised in 38258
where current RFC5424 sys log format does not zero pad
the time (trailing zeros are removed)
This fix apply the patch to fix the issue. This fix fixes 38258.
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
| ... | ... |
@@ -77,7 +77,7 @@ func rfc5424formatterWithAppNameAsTag(p syslog.Priority, hostname, tag, content |
| 77 | 77 |
// for multiple syntaxes, there are further restrictions in rfc5424, i.e., the maximum |
| 78 | 78 |
// resolution is limited to "TIME-SECFRAC" which is 6 (microsecond resolution) |
| 79 | 79 |
func rfc5424microformatterWithAppNameAsTag(p syslog.Priority, hostname, tag, content string) string {
|
| 80 |
- timestamp := time.Now().Format("2006-01-02T15:04:05.999999Z07:00")
|
|
| 80 |
+ timestamp := time.Now().Format("2006-01-02T15:04:05.000000Z07:00")
|
|
| 81 | 81 |
pid := os.Getpid() |
| 82 | 82 |
msg := fmt.Sprintf("<%d>%d %s %s %s %d %s - %s",
|
| 83 | 83 |
p, 1, timestamp, hostname, tag, pid, tag, content) |