Skip to content

Commit

Permalink
fix error invalid key-value pairs (#33)
Browse files Browse the repository at this point in the history
* fix logger info status and move correlation middleware and getLoggerFromContext from api-server

* fix lint issue

* resolve

* resolve

* resolve

* add errors in getlogger

* fix error invalid key-value pairs

* fix error check

* fixed context keys string

* revert
  • Loading branch information
0xmuralik authored Feb 11, 2022
1 parent ecee897 commit 02df8af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions logging/correlation.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func addCorrelationID(c *gin.Context, l *zap.SugaredLogger) {
if correlationID != "" {
ctx = context.WithValue(ctx, CorrelationIDName, correlationID)
c.Writer.Header().Set(ExternalCorrelationIDName, correlationID)
l = l.With(CorrelationIDName, correlationID)
l = l.With(string(CorrelationIDName), correlationID)
}

id, err := uuid.NewV4()
Expand All @@ -40,7 +40,7 @@ func addCorrelationID(c *gin.Context, l *zap.SugaredLogger) {
}

ctx = context.WithValue(ctx, IntCorrelationIDName, id.String())
l = l.With(IntCorrelationIDName, id)
l = l.With(string(IntCorrelationIDName), id)

c.Set("logger", l)

Expand Down

0 comments on commit 02df8af

Please sign in to comment.