From 3c15907427cfe19c0dd411147518b83c2845c078 Mon Sep 17 00:00:00 2001 From: pb Date: Mon, 2 Jun 2025 10:34:58 +0200 Subject: [PATCH] added id for logger --- tools/api.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/api.go b/tools/api.go index 1375970..93802a0 100644 --- a/tools/api.go +++ b/tools/api.go @@ -9,6 +9,7 @@ import ( "cloud.o-forge.io/core/oc-lib/dbs/mongo" "cloud.o-forge.io/core/oc-lib/logs" beego "github.com/beego/beego/v2/server/web" + "github.com/google/uuid" ) type APIRequest struct { @@ -135,7 +136,8 @@ func (a *API) CheckRemotePeer(url string) (State, map[string]int) { // CheckRemoteAPIs checks the state of remote APIs from your proper OC func (a *API) CheckRemoteAPIs(apis []DataType) (State, map[string]string, error) { - l := logs.GetLogger() + id := uuid.New() + l := logs.GetLogger().With().Str("id",id.String()).Logger() l.Debug().Msg("Start checking") // Check if the database is up new := map[string]string{}