modify log format

This commit is contained in:
MaysWind
2024-08-07 22:47:56 +08:00
parent caa27841ef
commit ea8021b359
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -33,7 +33,7 @@ func (c *XOrmContextAdapter) Err() error {
// if no value is associated with key.
func (c *XOrmContextAdapter) Value(key any) any {
if key == log.SessionIDKey && c.requestId != "" {
return fmt.Sprintf("r=%s", c.requestId)
return fmt.Sprintf("%s", c.requestId)
}
return nil
+1 -1
View File
@@ -42,7 +42,7 @@ func (f *LogFormatter) Format(entry *logrus.Entry) ([]byte, error) {
}
if requestId, exists := entry.Data[logFieldRequestId]; exists {
b.WriteString(fmt.Sprintf("[r=%s] ", requestId))
b.WriteString(fmt.Sprintf("[%s] ", requestId))
}
b.WriteString(entry.Message)