Open kopiczko opened 2 days ago
@smallinsky I reverted to my previous version because of https://github.com/gravitational/teleport/pull/49293/files#r1851984320. Please see if you're ok with it.
Is this really needed? The logger is already configurable, and can be adorned with the kind when it is passed in to the reconciler. This could now cause an additional kind attribute to show up in the logs.
See:
https://github.com/gravitational/teleport/blob/master/lib/srv/app/watcher.go#L44 https://github.com/gravitational/teleport/blob/master/lib/srv/db/watcher.go#L47
I mean, it isn't needed because as you said there is this With function on the Logger. I didn't figure it's being used in so many places. I proposed those changes because Okta-related reconcilers don't log kind and names are pretty cryptic.
I'm happy to remove all the currently used With("kind", ...)
calls if you think it's ok. It shouldn't be too difficult to grep for them. Alternatively, I can replace this PR with adding With
calls in Okta reconcilers. I think having kind added automatically by the Reconciler is nicer, but I won't insist.
@rosstimothy please let me know your thoughts.
It may be small in the grand scheme of things, but the biggest benefit to users manually annotating the kind by calling With
on the provided logger to the reconciler is that the argument is only formatted a single time, instead of being formatted each time a log is emitted. If we can automatically annotate the logger with kind a single time via With
instead of adding "kind", kind
to each logging statement let's do it.
This pull request is automatically being deployed by Amplify Hosting (learn more).
Access this pull request here: https://pr-49293.d3pp5qlev8mo18.amplifyapp.com