Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: Change log ts format to RFC3339 #1191

Merged
merged 1 commit into from
Mar 8, 2022
Merged

chore: Change log ts format to RFC3339 #1191

merged 1 commit into from
Mar 8, 2022

Conversation

mumoshu
Copy link
Collaborator

@mumoshu mumoshu commented Mar 8, 2022

The TimeEncoder for zap seems to have been set to EpochTimeEncoder which is the default and it was not very readable. Changing it to a TimeEncoderOfLayout(time.RFC3339) for readability.
Another benefit of doing this is the ts format is now consistent with various timestamps ARC put into pod and other custom resource annotations.

BEFORE:

{"level":"debug","ts":1646530339.3554308,"logger":"actions-runner-controller.horizontalrunnerautoscaler","msg":"Calculated desired replicas of 10","horizontalrunnerautoscaler":"default/org-runnerdeploy","suggested":2,"reserved":20,"min":2,"cached":2,"max":10}

AFTER:

{"level":"debug","ts":"2022-03-08T01:30:46Z","logger":"actions-runner-controller.horizontalrunnerautoscaler","msg":"Calculated desired replicas of 2","horizontalrunnerautoscaler":"default/enterprisegroup-runnerdeploy","suggested":2,"reserved":0,"min":2,"max":10,"cached":2}

The TimeEncoder for zap seems to have been set to EpochTimeEncoder which is the default and it was not very readable. Changing it to a TimeEncoderOfLayout(time.RFC3339) for readability.
Another benefit of doing this is the ts format is now consistent with various timestamps ARC put into pod and other custom resource annotations.
@mumoshu mumoshu merged commit 301439b into master Mar 8, 2022
@mumoshu mumoshu deleted the fix-log branch March 8, 2022 01:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant