fix: context key error in sql read write mode (#5000)

This commit is contained in:
Kevin Wan
2025-07-12 06:58:08 +08:00
committed by GitHub
parent bae8d4f4c8
commit a71e56de52
5 changed files with 28 additions and 29 deletions

View File

@@ -224,7 +224,7 @@ func (l *richLogger) buildFields(fields ...LogField) []LogField {
fields = append(fields, Field(spanKey, spanID))
}
val := l.ctx.Value(fieldsContextKey)
val := l.ctx.Value(fieldsKey{})
if val != nil {
if arr, ok := val.([]LogField); ok {
fields = append(fields, arr...)