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

print api request and response information to the console when log-level=debug #10053

Closed
brianwcook opened this issue Apr 16, 2021 · 13 comments · Fixed by #11517
Closed

print api request and response information to the console when log-level=debug #10053

brianwcook opened this issue Apr 16, 2021 · 13 comments · Fixed by #11517
Assignees
Labels
HTTP API Bug is in RESTful API In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@brianwcook
Copy link

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind feature

Description

In order to make troubleshooting easier it would be nice if podman would print api request and response information to the console when log-level=debug. This should include include all headers including tokens, request methods, request uri, payloads, etc. There should be enough to reconstruct the api calls using curl. the 'oc' command from OpenShift does this very nicely when you add lots of -vvvvvvv's.

Since some of the payloads can be large, more granular options for verbosity could be implemented. It's not so useful to get a tar file printed to my console, but I definitely want to be able to see the json of a manifest write operation.

Steps to reproduce the issue:

  1. do something with podman that would initiate communication with a registry endpoint

  2. add log-level=debug to cli

  3. observe output and wish that it included api request and response information

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

podman version 3.0.1

Additional environment details (AWS, VirtualBox, physical, etc.):

fedora 33

@openshift-ci-robot openshift-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 16, 2021
@baude
Copy link
Member

baude commented Apr 16, 2021

@jwhonce can you give the history here? I cannot quite remember it.

@jwhonce
Copy link
Member

jwhonce commented Apr 16, 2021

@baude We do this already on the service side for inbound API calls when started with --log-level=debug. @brianwcook mentions registry endpoint so I assume he wants c/images to do the same when making outbound calls to pull images etc. Buildah would also be a candidate if it making outbound calls not utilizing c/images.

/cc @vrothberg

@mheon
Copy link
Member

mheon commented Apr 16, 2021

This definitely seems worthwhile. We just added support for trace logging, and this is a good candidate.

@rhatdan
Copy link
Member

rhatdan commented Apr 17, 2021

Is there risk here of divulging secrets in logs? Do we need to be careful?

@mheon
Copy link
Member

mheon commented Apr 17, 2021

Hm. If we use TRACE level, and add a warning to the manpage that Trace will print everything, even potentially privileged data - would that be OK?

@rhatdan
Copy link
Member

rhatdan commented Apr 19, 2021

Yes, I am fine with it printing in tracelevel.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jun 30, 2021

@jwhonce any chance you can work on this?

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@jwhonce
Copy link
Member

jwhonce commented Aug 2, 2021

@rhatdan Researching into how to implement this and still stream in and out of handler. Holding whole payload in memory seems wasteful.

@github-actions
Copy link

github-actions bot commented Sep 2, 2021

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Sep 2, 2021

@jwhonce any progress?

@jwhonce jwhonce self-assigned this Sep 9, 2021
@jwhonce jwhonce added HTTP API Bug is in RESTful API In Progress This issue is actively being worked by the assignee, please do not work on this at this time. labels Sep 9, 2021
jwhonce added a commit to jwhonce/podman that referenced this issue Sep 10, 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 containers#10053

Signed-off-by: Jhon Honce <[email protected]>
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
HTTP API Bug is in RESTful API In Progress This issue is actively being worked by the assignee, please do not work on this at this time. kind/feature Categorizes issue or PR as related to a new feature. 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 a pull request may close this issue.

6 participants