mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-25 21:38:59 +02:00
feat: recovery logger with ctx (#1601)
Co-authored-by: 曾政 <zengz@weipaitang.com>
This commit is contained in:
parent
ce8ed35c1d
commit
f9a132c9dd
@ -56,7 +56,7 @@ func Recovery(opts ...Option) middleware.Middleware {
|
||||
buf := make([]byte, 64<<10) //nolint:gomnd
|
||||
n := runtime.Stack(buf, false)
|
||||
buf = buf[:n]
|
||||
logger.Errorf("%v: %+v\n%s\n", rerr, req, buf)
|
||||
logger.WithContext(ctx).Errorf("%v: %+v\n%s\n", rerr, req, buf)
|
||||
|
||||
err = op.handler(ctx, req, rerr)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user