summaryrefslogtreecommitdiff
path: root/internal/sshd/session.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/sshd/session.go')
-rw-r--r--internal/sshd/session.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/sshd/session.go b/internal/sshd/session.go
index b26edc5..b8e8625 100644
--- a/internal/sshd/session.go
+++ b/internal/sshd/session.go
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
+ "reflect"
"gitlab.com/gitlab-org/labkit/log"
"golang.org/x/crypto/ssh"
@@ -149,11 +150,17 @@ func (s *session) handleShell(ctx context.Context, req *ssh.Request) uint32 {
return 128
}
+ cmdName := reflect.TypeOf(cmd).String()
+ ctxlog := log.ContextLogger(ctx)
+ ctxlog.WithFields(log.Fields{"env": env, "command": cmdName}).Info("session: handleShell: executing command")
+
if err := cmd.Execute(ctx); err != nil {
s.toStderr(ctx, "remote: ERROR: %v\n", err.Error())
return 1
}
+ ctxlog.Info("session: handleShell: command executed successfully")
+
return 0
}