-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Change timestamp in elastic-agent-json.log ut UTC #26016
Change timestamp in elastic-agent-json.log ut UTC #26016
Conversation
Change encoder to force UTC timestamps in ISO-8601 for the json.log entries.
Pinging @elastic/agent (Team:Agent) |
return ecszap.WrapCore(zapcore.NewCore(encoder, rotator, cfg.Level.ZapLevel())), nil | ||
} | ||
|
||
// utcTimestampEncode is a zapcore.TimeEncoder that formats time.Time in ISO-8601 in UTC. |
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.
logp.JSONEncoderConfig
uses zap's ISO8601 encoder; this function copies that pattern but forces the time into UTC
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.
looks ok, i will test it a bit later
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
Trends 🧪💚 Flaky test reportTests succeeded. Expand to view the summary
Test stats 🧪
|
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.
Tested ok
Change encoder to force UTC timestamps in ISO-8601 for the json.log entries. (cherry picked from commit c65305b)
What does this PR do?
Change encoder to force UTC timestamps in RFC3339 for the json.log
entries.
Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues
Logs