diff --git a/proxy/proxy.go b/proxy/proxy.go index e936051..7bdceb5 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -65,6 +65,7 @@ func (pxy *Proxy) Start(ctx context.Context) { go func() { ctx := util.GetCtxWithTraceId(ctx) + logger := log.GetCtxLogger(ctx) pkt, err := packet.ReadHttpRequest(conn) if err != nil { diff --git a/util/log/log.go b/util/log/log.go index 4d1ee1e..6dab9a6 100644 --- a/util/log/log.go +++ b/util/log/log.go @@ -23,8 +23,8 @@ func GetCtxLogger(ctx context.Context) zerolog.Logger { func InitLogger(cfg *util.Config) { partsOrder := []string{ - zerolog.TimestampFieldName, zerolog.LevelFieldName, + zerolog.TimestampFieldName, traceIdFieldName, scopeFieldName, zerolog.MessageFieldName,