From ec6566c02b9c452d8e465ffa41c1c20117228917 Mon Sep 17 00:00:00 2001 From: Manish Tomar Date: Wed, 13 Feb 2019 08:49:37 -0800 Subject: [PATCH] Log authorized username This is useful to know which user pulled/pushed which repo. Signed-off-by: Manish Tomar --- registry/handlers/app.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/handlers/app.go b/registry/handlers/app.go index 5980753b..22587087 100644 --- a/registry/handlers/app.go +++ b/registry/handlers/app.go @@ -862,7 +862,7 @@ func (app *App) authorized(w http.ResponseWriter, r *http.Request, context *Cont return err } - dcontext.GetLogger(ctx).Info("authorized request") + dcontext.GetLogger(ctx, auth.UserNameKey).Info("authorized request") // TODO(stevvooe): This pattern needs to be cleaned up a bit. One context // should be replaced by another, rather than replacing the context on a // mutable object.