Logging with trace ID from header #2348
-
Can I have a trace ID each request and when logging it auto add as a field in message? And from request -> function -> response , if I call write log it auto print the trace-ID |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Are we talking about request logging or all log messages during request? If you are using RequestLogger middleware https://github.com/labstack/echo/blob/master/middleware/request_logger.go you can add this into Also RequestID middleware has |
Beta Was this translation helpful? Give feedback.
-
I resolve problem by custom zap logger with "With" function as parent logger and attach to echo.Context
`
` |
Beta Was this translation helpful? Give feedback.
I resolve problem by custom zap logger with "With" function as parent logger and attach to echo.Context
`
when need add key, I use