mirror of
https://github.com/containers/podman.git
synced 2025-09-19 23:03:16 +08:00
Make podman service log events
* Log endpoint calls at level Info * Ensure API server started at level Info Fixes #8390 Signed-off-by: Jhon Honce <jhonce@redhat.com>
This commit is contained in:
@ -30,14 +30,14 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc {
|
||||
// Wrapper to hide some boiler plate
|
||||
fn := func(w http.ResponseWriter, r *http.Request) {
|
||||
rid := uuid.New().String()
|
||||
logrus.Infof("APIHandler(%s) -- %s %s BEGIN", rid, r.Method, r.URL.String())
|
||||
if logrus.IsLevelEnabled(logrus.DebugLevel) {
|
||||
logrus.Debugf("APIHandler(%s) -- Method: %s URL: %s", rid, r.Method, r.URL.String())
|
||||
for k, v := range r.Header {
|
||||
switch auth.HeaderAuthName(k) {
|
||||
case auth.XRegistryConfigHeader, auth.XRegistryAuthHeader:
|
||||
logrus.Debugf("APIHandler(%s) -- Header: %s: <hidden>", rid, k)
|
||||
logrus.Debugf("APIHandler(%s) -- Header: %s=<hidden>", rid, k)
|
||||
default:
|
||||
logrus.Debugf("APIHandler(%s) -- Header: %s: %v", rid, k, v)
|
||||
logrus.Debugf("APIHandler(%s) -- Header: %s=%v", rid, k, v)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -63,6 +63,7 @@ func (s *APIServer) APIHandler(h http.HandlerFunc) http.HandlerFunc {
|
||||
w.Header().Set("Server", "Libpod/"+lv+" ("+runtime.GOOS+")")
|
||||
|
||||
h(w, r)
|
||||
logrus.Debugf("APIHandler(%s) -- %s %s END", rid, r.Method, r.URL.String())
|
||||
}
|
||||
fn(w, r)
|
||||
}
|
||||
|
Reference in New Issue
Block a user