diff --git a/pkg/common/log/zap.go b/pkg/common/log/zap.go index 09f610d5b..5fe5eefdd 100644 --- a/pkg/common/log/zap.go +++ b/pkg/common/log/zap.go @@ -55,11 +55,12 @@ type ZapLogger struct { func NewZapLogger() (*ZapLogger, error) { zapConfig := zap.Config{ - Level: zap.NewAtomicLevelAt(zapcore.DebugLevel), - Development: true, - Encoding: "json", - EncoderConfig: zap.NewProductionEncoderConfig(), - InitialFields: map[string]interface{}{"PID": os.Getegid()}, + Level: zap.NewAtomicLevelAt(zapcore.DebugLevel), + Development: true, + Encoding: "json", + EncoderConfig: zap.NewProductionEncoderConfig(), + DisableStacktrace: true, + InitialFields: map[string]interface{}{"PID": os.Getegid()}, } zl := &ZapLogger{} if config.Config.Log.Stderr { diff --git a/pkg/common/mw/rpc_client_interceptor.go b/pkg/common/mw/rpc_client_interceptor.go index d38ad9981..e0c42ea9d 100644 --- a/pkg/common/mw/rpc_client_interceptor.go +++ b/pkg/common/mw/rpc_client_interceptor.go @@ -20,7 +20,7 @@ func rpcClientInterceptor(ctx context.Context, method string, req, resp interfac if ctx == nil { return errs.ErrInternalServer.Wrap("call rpc request context is nil") } - log.ZInfo(ctx, "rpc req", "req", "funcName", method, rpcString(req)) + log.ZInfo(ctx, "rpc client req", "req", "funcName", method, rpcString(req)) operationID, ok := ctx.Value(constant.OperationID).(string) if !ok { log.ZWarn(ctx, "ctx missing operationID", errors.New("ctx missing operationID"), "funcName", method) @@ -33,7 +33,7 @@ func rpcClientInterceptor(ctx context.Context, method string, req, resp interfac } err = invoker(metadata.NewOutgoingContext(ctx, md), method, req, resp, cc, opts...) if err == nil { - log.ZInfo(ctx, "rpc resp", "funcName", method, rpcString(resp)) + log.ZInfo(ctx, "rpc client resp", "funcName", method, rpcString(resp)) return nil } log.ZError(ctx, "rpc resp error", err)