summaryrefslogtreecommitdiff
path: root/internal/sshd/server_config.go
diff options
context:
space:
mode:
authorIgor Drozdov <idrozdov@gitlab.com>2021-09-15 20:46:00 +0300
committerIgor Drozdov <idrozdov@gitlab.com>2021-09-15 20:46:08 +0300
commitaf3aac6b459791fabd8ebc306cdff47c609fbf53 (patch)
tree159c78d0b98126365dd3f3f08502e4c4a5110033 /internal/sshd/server_config.go
parent3f640bdafe429501897541cadf2c268b13c4cf9f (diff)
downloadgitlab-shell-id-context-fields.tar.gz
Add context fields to loggingid-context-fields
It adds correlation ids wherever possible
Diffstat (limited to 'internal/sshd/server_config.go')
-rw-r--r--internal/sshd/server_config.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/internal/sshd/server_config.go b/internal/sshd/server_config.go
index 7306944..68210f8 100644
--- a/internal/sshd/server_config.go
+++ b/internal/sshd/server_config.go
@@ -32,12 +32,12 @@ func newServerConfig(cfg *config.Config) (*serverConfig, error) {
for _, filename := range cfg.Server.HostKeyFiles {
keyRaw, err := os.ReadFile(filename)
if err != nil {
- log.WithError(err).Warnf("Failed to read host key %v", filename)
+ log.WithError(err).WithFields(log.Fields{"filename": filename}).Warn("Failed to read host key")
continue
}
key, err := ssh.ParsePrivateKey(keyRaw)
if err != nil {
- log.WithError(err).Warnf("Failed to parse host key %v", filename)
+ log.WithError(err).WithFields(log.Fields{"filename": filename}).Warn("Failed to parse host key")
continue
}