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

logging: add similar logging to v3 #1041

Merged
merged 3 commits into from
Sep 17, 2020
Merged

logging: add similar logging to v3 #1041

merged 3 commits into from
Sep 17, 2020

Conversation

mcoops
Copy link
Contributor

@mcoops mcoops commented Sep 15, 2020

Add back in HTTP logging to what was present in v3, to each of the handlers.

Matched the existing format/fields from v3 here:

func loggingHandler(h http.Handler) http.Handler {

Didn't add tests as there isn't really much to test.

@app-sre-bot
Copy link
Collaborator

Can one of the admins verify this patch?

Add back in HTTP logging to what was present in v3, to each of the handlers.

Signed-off-by: mcoops <cooper.d.mark@gmail.com>
ldelossa
ldelossa previously approved these changes Sep 15, 2020
Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

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

Looks good, small nit.

httptransport/logginghandler.go Show resolved Hide resolved
Str("remote addr", r.RemoteAddr).
Str("method", r.Method).
Str("request uri", r.RequestURI).
Str("status", strconv.Itoa(http.StatusOK)).
Copy link
Collaborator

@Allda Allda Sep 15, 2020

Choose a reason for hiding this comment

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

Does this always log 200?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's embarrassing runs I hate how that works. Readding

Signed-off-by: mcoops <cooper.d.mark@gmail.com>
@mcoops
Copy link
Contributor Author

mcoops commented Sep 15, 2020

I assume we squash on merge? Otherwise can rebase.

httptransport/logginghandler.go Outdated Show resolved Hide resolved
httptransport/logginghandler.go Show resolved Hide resolved
Signed-off-by: mcoops <cooper.d.mark@gmail.com>
Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

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

Looks good to me. I suggest running Clair in local dev or on prem to ensure the logs work correctly.

@ldelossa ldelossa merged commit e45c1e1 into quay:development-4.0 Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants