fix: make create session works
This commit is contained in:
@ -27,7 +27,7 @@ import (
|
||||
"sync"
|
||||
|
||||
"git.vinchent.xyz/vinchent/howmuch/internal/pkg/core"
|
||||
"git.vinchent.xyz/vinchent/howmuch/internal/pkg/middleware"
|
||||
"git.vinchent.xyz/vinchent/howmuch/internal/pkg/shared"
|
||||
"go.uber.org/zap"
|
||||
"go.uber.org/zap/zapcore"
|
||||
)
|
||||
@ -110,8 +110,12 @@ func CtxLog(ctx core.Context) *zapLogger {
|
||||
func (z *zapLogger) CtxLog(ctx core.Context) *zapLogger {
|
||||
zz := z.clone()
|
||||
|
||||
if rid := ctx.GetHeader(middleware.XRequestID); rid != "" {
|
||||
zz.z = zz.z.With(zap.Any(middleware.XRequestID, rid))
|
||||
if rid := ctx.GetHeader(shared.XRequestID); rid != "" {
|
||||
zz.z = zz.z.With(zap.Any(shared.XRequestID, rid))
|
||||
}
|
||||
|
||||
if user := ctx.GetHeader(shared.XUserName); user != "" {
|
||||
zz.z = zz.z.With(zap.Any(shared.XUserName, user))
|
||||
}
|
||||
|
||||
return zz
|
||||
|
Reference in New Issue
Block a user