modify log format
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user