-
Notifications
You must be signed in to change notification settings - Fork 2k
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
switch to using logr for structured logging #1409
Conversation
It may also be easier if I split this PR up into:
|
d4c20ed
to
5c03f3b
Compare
d3f649f
to
a35d6e7
Compare
d33187f
to
ea5a728
Compare
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.
This looks good to me, give me a ping when it's rebased for a lgtm
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
Signed-off-by: James Munnelly <james@munnelly.eu>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kragniz, munnerz The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
I've rebased - it appears to be flaking on DNS01 tests, but I can't see anything related to this PR. /retest |
/retest |
What this PR does / why we need it:
This is a first pass at us switching to logr for structured logging.
I've chosen to plumb the actual logr instance through via the
context.Context
(golang context) variable, as it also allows us to handle cancellation etc all in one.I've not converted the entire codebase yet - we need to continue going through:
log := logf.FromContext(ctx)
klog.*
withlog.*
runtime.HandleError
withlog.Error(err, "...")
This will probably take a while to do properly, but can at least be split up into different chunks 😄
We should also work out what sort of log levels we want to support. I'd like to have a relatively quiet 'info' level, then one that includes debug information, and potentially another that logs all of the things (i.e. before and after), similar to 'trace'. I'm not sure if we're better to not include 'trace' for now, in favour of a very chatting debug level 😄
I'd also like to include some kind of 'sync uuid' field in the logger, so that users can correlate all the logs from a specific call to the Sync function when debugging.
Which issue this PR fixes: fixes #712
Special notes for your reviewer:
Release note: