Skip to content
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

Standardised logging timestamp to ISO8601 #1625

Merged
merged 1 commit into from
Jun 18, 2021

Conversation

tkishore1192
Copy link
Contributor

Atlantis version - atlantis 0.17.0

Issue -
With the current format of logs, the timestamp is printed in the format -
{"level":"info","ts":1623266081.273087,"caller":"server/server.go:715","msg":"All in-progress operations complete, shutting down","json":{}}
This particular format makes it really difficult or impossible to ingest atlantis logs into logging system like ELK. Also to the bare eye it is difficult to understand the format.

Solution offered -
Zap logs can be formatted to be printed in ISO8601 standards. This has been configured in the logger initialisation. With this configs logs are printed in the below format -
{"level":"info","ts":"2021-06-10T00:44:51.559+0530","caller":"server/server.go:148","msg":"Policy Checks are enabled","json":{}}

This format is more readable and easier to ingest into logging system like ELK.

@tkishore1192 tkishore1192 requested a review from a team as a code owner June 9, 2021 19:33
@tkishore1192
Copy link
Contributor Author

@nishkrishnan - Hello, would it be possible for you to look into this PR? Thank you!

Copy link
Contributor

@nishkrishnan nishkrishnan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tkishore1192
Copy link
Contributor Author

@nishkrishnan - Thanks a ton! Appreciate the quick review. Would you be able to merge this request?

@chenrui333 chenrui333 merged commit 1f0cb3f into runatlantis:master Jun 18, 2021
@chenrui333
Copy link
Member

Thanks @tkishore1192 for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants