diff --git a/internal/worker/task_scheduler.go b/internal/worker/task_scheduler.go index 8ab92d4..5aaeea8 100644 --- a/internal/worker/task_scheduler.go +++ b/internal/worker/task_scheduler.go @@ -316,8 +316,12 @@ func (s *TaskScheduler) run(ctx context.Context, task *taskbiz.TimedTask, trigge logger.Error("timed task execution skipped because executor is unavailable", "task_id", taskID, "task_name", taskName, "trigger_type", trigger) return } + logger.InfoContext(ctx, "timed task started", "task_id", taskID, "task_name", taskName, "trigger_type", trigger) log := s.executor.Run(ctx, task, trigger) attributes := []any{"task_id", log.TaskID, "task_name", log.TaskName, "trigger_type", log.TriggerType, "status", log.Status, "duration_ms", log.DurationMS, "started_at", log.StartedAt, "finished_at", log.FinishedAt} + if log.Output != "" { + attributes = append(attributes, "output", log.Output) + } if log.ErrorMsg != "" { attributes = append(attributes, "error", log.ErrorMsg) }