Skip to content

Commit

Permalink
PF-3547 slugify log keys
Browse files Browse the repository at this point in the history
  • Loading branch information
svenwltr committed Aug 12, 2024
1 parent 4da6985 commit a1a342b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/logutil/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"path"
"strings"

"github.com/gosimple/slug"
"github.com/mitchellh/mapstructure"
"github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -77,7 +78,7 @@ func Start(ctx context.Context, subsystem string, opts ...ContextOption) context
ids := []string{}

for _, t := range m.path {
name := fmt.Sprintf("trace-id-%s", t.subsystem)
name := fmt.Sprintf("trace-id-%s", slug.Make(t.subsystem))
m.log = m.log.WithField(name, t.id)
ids = append(ids, t.id)
}
Expand Down

0 comments on commit a1a342b

Please sign in to comment.