fix(observabillity): add service_name tag to logs
This commit was merged in pull request #186.
This commit is contained in:
@@ -27,6 +27,8 @@ func (l *logHandler) Enabled(ctx context.Context, level slog.Level) bool {
|
|||||||
|
|
||||||
// Handle implements slog.Handler.
|
// Handle implements slog.Handler.
|
||||||
func (l *logHandler) Handle(ctx context.Context, rec slog.Record) error {
|
func (l *logHandler) Handle(ctx context.Context, rec slog.Record) error {
|
||||||
|
rec.AddAttrs(slog.String("service_name", "spend-sparrow"))
|
||||||
|
|
||||||
if err := l.console.Handle(ctx, rec); err != nil {
|
if err := l.console.Handle(ctx, rec); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user