diff --git a/configuration/template/stackutil.go b/configuration/template/stackutil.go index 1e58fb69..44ce4a29 100644 --- a/configuration/template/stackutil.go +++ b/configuration/template/stackutil.go @@ -27,6 +27,7 @@ package template import ( "encoding/json" "fmt" + "github.com/AliceO2Group/Control/common/logger/infologger" texttemplate "text/template" "time" @@ -51,8 +52,8 @@ func getConfigLegacy(confSvc ConfigurationService, varStack map[string]string, p fields := Fields{WrapPointer(&payload)} err = fields.Execute(confSvc, query.Path(), varStack, nil, nil, make(map[string]texttemplate.Template), nil) - log.Warn(varStack) - log.Warn(payload) + log.WithField("level", infologger.IL_Devel).Debug(varStack) + log.WithField("level", infologger.IL_Devel).Debug(payload) return payload } @@ -68,8 +69,8 @@ func getConfig(confSvc ConfigurationService, varStack map[string]string, path st return fmt.Sprintf("{\"error\":\"%s\"}", err.Error()) } - log.Warn(varStack) - log.Warn(payload) + log.WithField("level", infologger.IL_Devel).Debug(varStack) + log.WithField("level", infologger.IL_Devel).Debug(payload) return payload } diff --git a/core/environment/transition_deploy.go b/core/environment/transition_deploy.go index 652b5325..ed7e6e45 100644 --- a/core/environment/transition_deploy.go +++ b/core/environment/transition_deploy.go @@ -342,9 +342,9 @@ func (t DeployTransition) do(env *Environment) (err error) { } if err != nil { - log.WithError(err). + log.WithField("level", infologger.IL_Ops). WithField("partition", env.Id().String()). - Error("deployment error") + Error(err) return } diff --git a/core/task/manager.go b/core/task/manager.go index 83139c69..d04964f2 100644 --- a/core/task/manager.go +++ b/core/task/manager.go @@ -1207,7 +1207,8 @@ func (m *Manager) handleMessage(tm *TaskmanMessage) error { if err != nil { log.WithError(err). WithField("partition", tm.GetEnvironmentId().String()). - Errorf("Failed task creation and Mesos resources allocation during the deployment of the environment. For more details check Devel logs in Info Logger.") + WithField("level", infologger.IL_Support). + Errorf("failed task creation and Mesos resources allocation during the deployment of the environment. More details in Devel logs.") } }() case taskop.ConfigureTasks: diff --git a/core/workflow/taskrole.go b/core/workflow/taskrole.go index bbeaf3e3..3b294b2a 100644 --- a/core/workflow/taskrole.go +++ b/core/workflow/taskrole.go @@ -257,11 +257,20 @@ func (t *taskRole) updateState(s sm.State) { EnvironmentId: t.GetEnvironmentId().String(), }) if t.state.get() == sm.ERROR { - log.WithField("partition", t.GetEnvironmentId().String()). - WithField("level", infologger.IL_Support). - WithField("role", t.Name). - WithField("critical", t.Critical). - Error("task went into ERROR") + host := "unknown" + if t.Task != nil { + host = t.Task.GetHostname() + } + if t.Critical { + log.WithField("partition", t.GetEnvironmentId().String()). + WithField("level", infologger.IL_Ops). + Errorf("critical task '%s' on host '%s' went into ERROR, the environment will stop or tear down", t.Name, host) + } else { + log.WithField("partition", t.GetEnvironmentId().String()). + WithField("level", infologger.IL_Ops). + Errorf("non-critical task '%s' on host '%s' went into ERROR, but the environment might continue", t.Name, host) + } + } } t.SendEvent(&event.RoleEvent{Name: t.Name, State: t.state.get().String(), RolePath: t.GetPath()}) diff --git a/executor/executable/controllabletask.go b/executor/executable/controllabletask.go index 861ee133..a4cf5b34 100644 --- a/executor/executable/controllabletask.go +++ b/executor/executable/controllabletask.go @@ -550,7 +550,8 @@ func (t *ControllableTask) Launch() error { WithField("taskId", taskId). WithField("taskName", t.ti.Name). WithField("taskPid", t.knownPid). - Warningf("task %s transitioned to ERROR on its own - notifying environment", deo.TaskId.String()) + WithField("level", infologger.IL_Support). + Warningf("task transitioned to ERROR on its own - notifying environment") } } deviceEvent.SetLabels(map[string]string{"detector": t.knownDetector, "environmentId": t.knownEnvironmentId.String()})