Skip to content

Commit

Permalink
improve logging when using multiple workspaces
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
  • Loading branch information
mblaschke committed May 7, 2021
1 parent f2bbcd9 commit 594495c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ func handleProbeRequest(w http.ResponseWriter, r *http.Request) {

resultTotalRecords := 0
for _, workspaceId := range opts.Loganalytics.Workspace {
workspaceLogger := contextLogger.WithField("workspaceId", workspaceId)

// Set options
workspaces := []string{}
queryBody := operationalinsights.QueryBody{
Expand Down Expand Up @@ -135,9 +137,9 @@ func handleProbeRequest(w http.ResponseWriter, r *http.Request) {
}
}

contextLogger.Debug("metrics parsed")
workspaceLogger.Debug("metrics parsed")
} else {
contextLogger.Errorln(queryErr.Error())
workspaceLogger.Errorln(queryErr.Error())
http.Error(w, queryErr.Error(), http.StatusBadRequest)
return
}
Expand Down

0 comments on commit 594495c

Please sign in to comment.