From e441e3882b184cc2fa18e7eb0b84d3802253a0aa Mon Sep 17 00:00:00 2001 From: Steven Date: Sun, 3 Mar 2024 14:20:59 +0800 Subject: [PATCH] chore: update error logger --- server/route/api/v2/logger_interceptor.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/route/api/v2/logger_interceptor.go b/server/route/api/v2/logger_interceptor.go index 7332d255..0761e787 100644 --- a/server/route/api/v2/logger_interceptor.go +++ b/server/route/api/v2/logger_interceptor.go @@ -41,4 +41,7 @@ func (*LoggerInterceptor) loggerInterceptorDo(ctx context.Context, fullMethod st logMsg = "unknown error" } slog.LogAttrs(ctx, logLevel, logMsg, slog.String("method", fullMethod)) + if err != nil { + slog.LogAttrs(ctx, logLevel, "", slog.String("error", err.Error())) + } }