diff --git a/pkg/common/log/logrus.go b/pkg/common/log/logrus.go index c92e0655e..adb6a05f7 100644 --- a/pkg/common/log/logrus.go +++ b/pkg/common/log/logrus.go @@ -33,7 +33,7 @@ func init() { func NewPrivateLog(moduleName string) { logger = loggerInit(moduleName) - ctxLogger = loggerInit(moduleName) + ctxLogger = ctxLoggerInit(moduleName) } func ctxLoggerInit(moduleName string) *Logger { diff --git a/pkg/common/trace_log/ctx.go b/pkg/common/trace_log/ctx.go index ca7f4ea37..dc5b5873a 100644 --- a/pkg/common/trace_log/ctx.go +++ b/pkg/common/trace_log/ctx.go @@ -179,7 +179,7 @@ func SetContextInfo(ctx context.Context, funcName string, logLevel logrus.Level, funcInfo.FuncName = funcName funcInfo.Err = err funcInfo.LogLevel = logLevel - _, file, line, _ := runtime.Caller(0) + _, file, line, _ := runtime.Caller(2) var s string i := strings.SplitAfter(file, "/") if len(i) > 3 {