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

Align k8gb logging statements with zerolog best practices #469

Closed
somaritane opened this issue May 5, 2021 · 0 comments · Fixed by #597
Closed

Align k8gb logging statements with zerolog best practices #469

somaritane opened this issue May 5, 2021 · 0 comments · Fixed by #597
Labels
enhancement New feature or request
Milestone

Comments

@somaritane
Copy link
Contributor

After we adopted zerolog, we're still not fully utilizing it's potential, such as structured logging.
For example, right now our logging statements look like this:

log.Info().Msgf("Deleting delegated zone(%s)...", p.config.DNSZone)

while we could make them more contextual and enable better log analysis:

log.Info().Str("DelegatedZone", p.config.DNSZone).Msg("Deleting delegated zone")

We should update our existing logging statements to make them concise, useful, and aligned with zerolog best practices.

@ytsarev ytsarev added the enhancement New feature or request label May 13, 2021
@ytsarev ytsarev added this to the 0.9 milestone May 13, 2021
@kuritka kuritka self-assigned this Sep 1, 2021
kuritka added a commit that referenced this issue Sep 3, 2021
 closes #469

 - removing duplicit error message: `log.Err(err).Msgf("...(%s)",err)` I'm replacing with `log.Err(err).Msg("...")`
 - replacing with contextual message: `log.Info().Msgf("started provider (%s)",reconciler.DNSProvider.String)` I'm replacing with `log.Info().Str("provider", reconciler.DNSProvider.String()).Msg("started")`
 - I had to extend DNSProvider with Stringer interface. added String() string function

Signed-off-by: kuritka <kuritka@gmail.com>
kuritka added a commit that referenced this issue Sep 9, 2021
closes #469

 - removing duplicit error message: `log.Err(err).Msgf("...(%s)",err)` I'm replacing with `log.Err(err).Msg("...")`
 - replacing with contextual message: `log.Info().Msgf("started provider (%s)",reconciler.DNSProvider.String)` I'm replacing with `log.Info().Str("provider", reconciler.DNSProvider.String()).Msg("started")`
 - I had to extend DNSProvider with Stringer interface. added String() string function

Signed-off-by: kuritka <kuritka@gmail.com>
@somaritane somaritane moved this to Done in k8gb Jul 25, 2022
@somaritane somaritane added this to k8gb Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants