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

Refactor API server emphasis on logging #11517

Merged
merged 1 commit into from
Sep 12, 2021

Conversation

jwhonce
Copy link
Member

@jwhonce jwhonce commented Sep 9, 2021

  • To aid in debugging log API request and response bodies at trace
    level. Events can be correlated using the X-Reference-Id.
  • Server now echos X-Reference-Id from client if set, otherwise
    generates an unique id.
  • Move logic for X-Reference-Id into middleware
  • Change uses of Header.Add() to Set() when setting Content-Type
  • Log API operations in Apache format using gorilla middleware
  • Port server code to use BaseContext and ConnContext

Fixes #10053

Signed-off-by: Jhon Honce jhonce@redhat.com

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 9, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jwhonce

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 9, 2021
go.mod Outdated Show resolved Hide resolved
pkg/api/server/server.go Outdated Show resolved Hide resolved
@jwhonce jwhonce force-pushed the issues/10053 branch 2 times, most recently from 1b94f9c to 4729ebd Compare September 10, 2021 16:46
@jwhonce jwhonce self-assigned this Sep 10, 2021
@jwhonce jwhonce added HTTP API Bug is in RESTful API kind/cleanup Categorizes issue or PR as related to cleanup. labels Sep 10, 2021
@jwhonce jwhonce force-pushed the issues/10053 branch 3 times, most recently from 254bacd to ae32276 Compare September 10, 2021 20:05
* To aid in debugging log API request and response bodies at trace
  level. Events can be correlated using the X-Reference-Id.
* Server now echos X-Reference-Id from client if set, otherwise
  generates an unique id.
* Move logic for X-Reference-Id into middleware
* Change uses of Header.Add() to Set() when setting Content-Type
* Log API operations in Apache format using gorilla middleware
* Port server code to use BaseContext and ConnContext

Fixes containers#10053

Signed-off-by: Jhon Honce <jhonce@redhat.com>
@TomSweeneyRedHat
Copy link
Member

LGTM
and happy green test buttons.

@mheon
Copy link
Member

mheon commented Sep 12, 2021

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 12, 2021
@openshift-merge-robot openshift-merge-robot merged commit f785d8d into containers:main Sep 12, 2021
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. HTTP API Bug is in RESTful API kind/cleanup Categorizes issue or PR as related to cleanup. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

print api request and response information to the console when log-level=debug
5 participants