Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Commit eb0b74c

Browse files
committed
Add Quesma version to the logging context
1 parent 8104a3a commit eb0b74c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

platform/v2/core/quesma_logger.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package quesma_api
55
import (
66
"context"
77
"fmt"
8+
"github.com/QuesmaOrg/quesma/platform/buildinfo"
89
"github.com/QuesmaOrg/quesma/platform/v2/core/tracing"
910
"github.com/hashicorp/golang-lru/v2/expirable"
1011
"github.com/rs/zerolog"
@@ -19,6 +20,7 @@ const (
1920
Path = "path"
2021
AsyncId = "async_id"
2122
OpaqueId = "opaque_id"
23+
Version = "version"
2224

2325
DefaultBurstSamplerPeriodSeconds = 20 // burst up to 600 lines of logs per 20 seconds period
2426
DefaultBurstSamplerMaxLogsPerSecond = 30 // ~100k lines of logs per hour
@@ -163,6 +165,8 @@ func (l *QuesmaLoggerImpl) addKnownContextValues(event *zerolog.Event, ctx conte
163165
event = event.Str(OpaqueId, requestId)
164166
}
165167

168+
event = event.Str(Version, buildinfo.Version)
169+
166170
return event
167171
}
168172

0 commit comments

Comments
 (0)