1
0
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:
Evan 2021-11-04 19:40:34 +08:00 committed by GitHub
parent ce8ed35c1d
commit f9a132c9dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}