diff --git a/task/task.go b/task/task.go index eb90dd6..0a9e355 100644 --- a/task/task.go +++ b/task/task.go @@ -7,6 +7,7 @@ import ( cron "github.com/robfig/cron/v3" "github.com/rs/zerolog" "github.com/rs/zerolog/log" + "kumoly.io/kumoly/app/util" ) var l zerolog.Logger @@ -60,7 +61,10 @@ func (t *_task) Run() { } defer func() { if err := recover(); err != nil { - l.Error().Str("error", fmt.Sprint(err)).Msg("") + l.Error().Str("task_id", t.Task.ID). + Str("task_name", t.name).Str("trace", util.Stack()). + Str("error", fmt.Sprint(err)).Msg("task paniced") + } else if t.once { c.Remove(t.id) }