From 70c1b494b81f0035b71e47a65a70a8b86a2c8427 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Sat, 7 Mar 2020 00:46:26 -0800 Subject: Log internal HTTP requests This restores the previous behavior of logging the success and failures of internal HTTP requests. Part of https://gitlab.com/gitlab-org/gitlab/issues/207916 --- cmd/check/main.go | 3 +++ cmd/gitlab-shell-authorized-keys-check/main.go | 3 +++ cmd/gitlab-shell-authorized-principals-check/main.go | 3 +++ cmd/gitlab-shell/main.go | 3 +++ 4 files changed, 12 insertions(+) (limited to 'cmd') diff --git a/cmd/check/main.go b/cmd/check/main.go index a72d38c..e88b9fe 100644 --- a/cmd/check/main.go +++ b/cmd/check/main.go @@ -8,6 +8,7 @@ import ( "gitlab.com/gitlab-org/gitlab-shell/internal/command/readwriter" "gitlab.com/gitlab-org/gitlab-shell/internal/config" "gitlab.com/gitlab-org/gitlab-shell/internal/executable" + "gitlab.com/gitlab-org/gitlab-shell/internal/logger" ) func main() { @@ -29,6 +30,8 @@ func main() { os.Exit(1) } + logger.Configure(config) + cmd, err := command.New(executable, os.Args[1:], config, readWriter) if err != nil { fmt.Fprintf(readWriter.ErrOut, "%v\n", err) diff --git a/cmd/gitlab-shell-authorized-keys-check/main.go b/cmd/gitlab-shell-authorized-keys-check/main.go index 8cc0bc8..4b3949c 100644 --- a/cmd/gitlab-shell-authorized-keys-check/main.go +++ b/cmd/gitlab-shell-authorized-keys-check/main.go @@ -9,6 +9,7 @@ import ( "gitlab.com/gitlab-org/gitlab-shell/internal/config" "gitlab.com/gitlab-org/gitlab-shell/internal/console" "gitlab.com/gitlab-org/gitlab-shell/internal/executable" + "gitlab.com/gitlab-org/gitlab-shell/internal/logger" ) func main() { @@ -30,6 +31,8 @@ func main() { os.Exit(1) } + logger.Configure(config) + cmd, err := command.New(executable, os.Args[1:], config, readWriter) if err != nil { // For now this could happen if `SSH_CONNECTION` is not set on diff --git a/cmd/gitlab-shell-authorized-principals-check/main.go b/cmd/gitlab-shell-authorized-principals-check/main.go index 328e11f..fc46180 100644 --- a/cmd/gitlab-shell-authorized-principals-check/main.go +++ b/cmd/gitlab-shell-authorized-principals-check/main.go @@ -9,6 +9,7 @@ import ( "gitlab.com/gitlab-org/gitlab-shell/internal/config" "gitlab.com/gitlab-org/gitlab-shell/internal/console" "gitlab.com/gitlab-org/gitlab-shell/internal/executable" + "gitlab.com/gitlab-org/gitlab-shell/internal/logger" ) func main() { @@ -30,6 +31,8 @@ func main() { os.Exit(1) } + logger.Configure(config) + cmd, err := command.New(executable, os.Args[1:], config, readWriter) if err != nil { // For now this could happen if `SSH_CONNECTION` is not set on diff --git a/cmd/gitlab-shell/main.go b/cmd/gitlab-shell/main.go index 7751e4d..8df781c 100644 --- a/cmd/gitlab-shell/main.go +++ b/cmd/gitlab-shell/main.go @@ -9,6 +9,7 @@ import ( "gitlab.com/gitlab-org/gitlab-shell/internal/config" "gitlab.com/gitlab-org/gitlab-shell/internal/console" "gitlab.com/gitlab-org/gitlab-shell/internal/executable" + "gitlab.com/gitlab-org/gitlab-shell/internal/logger" ) func main() { @@ -30,6 +31,8 @@ func main() { os.Exit(1) } + logger.Configure(config) + cmd, err := command.New(executable, os.Args[1:], config, readWriter) if err != nil { // For now this could happen if `SSH_CONNECTION` is not set on -- cgit v1.2.1