diff --git a/.changelog/15842.txt b/.changelog/15842.txt new file mode 100644 index 000000000..78a64ce18 --- /dev/null +++ b/.changelog/15842.txt @@ -0,0 +1,3 @@ +```release-note:improvement +client: Log task events at INFO log level +``` diff --git a/client/allocrunner/taskrunner/task_runner.go b/client/allocrunner/taskrunner/task_runner.go index 6f2291e12..e8107f19b 100644 --- a/client/allocrunner/taskrunner/task_runner.go +++ b/client/allocrunner/taskrunner/task_runner.go @@ -1256,8 +1256,6 @@ func (tr *TaskRunner) UpdateState(state string, event *structs.TaskEvent) { tr.logger.Trace("setting task state", "state", state) if event != nil { - tr.logger.Trace("appending task event", "state", state, "event", event.Type) - // Append the event tr.appendEvent(event) } @@ -1370,6 +1368,8 @@ func (tr *TaskRunner) appendEvent(event *structs.TaskEvent) error { tr.state.LastRestart = time.Unix(0, event.Time) } + tr.logger.Info("Task event", "type", event.Type, "msg", event.DisplayMessage, "failed", event.FailsTask) + // Append event to slice appendTaskEvent(tr.state, event, tr.maxEvents) diff --git a/client/logmon/logmon.go b/client/logmon/logmon.go index ca01f5ebb..36bdd9317 100644 --- a/client/logmon/logmon.go +++ b/client/logmon/logmon.go @@ -195,7 +195,7 @@ func (l *logRotatorWrapper) isRunning() bool { // newLogRotatorWrapper takes a rotator and returns a wrapper that has the // processOutWriter to attach to the stdout or stderr of a process. func newLogRotatorWrapper(path string, logger hclog.Logger, rotator io.WriteCloser) (*logRotatorWrapper, error) { - logger.Info("opening fifo", "path", path) + logger.Debug("opening fifo", "path", path) var openFn func() (io.ReadCloser, error) var err error