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

Consistent Logging Severity #1356

Merged
merged 7 commits into from Jul 13, 2022
Merged

Conversation

danail-branekov
Copy link
Member

Is there a related GitHub Issue?

#1340

What is this change about?

  • Introduce HTTP request/response logging
  • apierrors.LogAndReturn supports wrapped errors
  • Introduce unauthenticatedHandlerWrapper
  • Do not return apierrors.UnknownError from build repo
  • CertInspector returns invalid auth errors on bad user input
  • Do not send any body with 204 status code
  • Use correct severity for logs by using apierrors.LogAndReturn

Does this PR introduce a breaking change?

No

Acceptance Steps

No logs at the error level after running e2e suite

Tag your pair, your PM, and/or team

@kieron-dev

Things to remember

Copy link
Contributor

@kieron-dev kieron-dev left a comment

Choose a reason for hiding this comment

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

lgtm

danail-branekov and others added 7 commits July 12, 2022 16:11
- Output URL, method, contentLength, remoteAddr for requests
- Output statusCode, size, duration for responses
- Correlation IDs included with both

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Logs will be info level if error is or wraps an apierrors error,
otherwise at error level

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
and use in unauthenticated endpoints. This allows consistent logging
with the correlation-id enhanced logger, for example.

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
This error type is intended for wrapping unknown errors by the handler
wrapping / presenting framework. In these cases, a plain error is the
correct type to return.

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
It is not correct to return plain errors here as they translate to 503
http response statuses

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
This showed up as an error with the improved logging, but wasn't causing
any user noticable problem

Co-authored-by: Kieron Browne <kbrowne@vmware.com>
Co-authored-by: Kieron Browne <kbrowne@vmware.com>
@kieron-dev kieron-dev force-pushed the issues/1340-consitent-log-severity branch from adfeedf to b74e94c Compare July 12, 2022 16:11
@danail-branekov danail-branekov merged commit 349624e into main Jul 13, 2022
@danail-branekov danail-branekov deleted the issues/1340-consitent-log-severity branch July 13, 2022 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants