Worker: also log job UUID when running a task
Having both the job and task UUIDs in the log output helps when debugging.
This commit is contained in:
parent
c504e68d8e
commit
84cff6919a
@ -48,7 +48,10 @@ func NewTaskExecutor(cmdRunner CommandRunner, listener TaskExecutionListener) *T
|
|||||||
// Run runs a task.
|
// Run runs a task.
|
||||||
// Returns ErrTaskReassigned when the task was reassigned to another worker.
|
// Returns ErrTaskReassigned when the task was reassigned to another worker.
|
||||||
func (te *TaskExecutor) Run(ctx context.Context, task api.AssignedTask) error {
|
func (te *TaskExecutor) Run(ctx context.Context, task api.AssignedTask) error {
|
||||||
logger := log.With().Str("task", task.Uuid).Logger()
|
logger := log.With().
|
||||||
|
Str("task", task.Uuid).
|
||||||
|
Str("job", task.Job).
|
||||||
|
Logger()
|
||||||
logger.Info().Str("taskType", task.TaskType).Msg("starting task")
|
logger.Info().Str("taskType", task.TaskType).Msg("starting task")
|
||||||
|
|
||||||
if err := te.listener.TaskStarted(ctx, task.Uuid); err != nil {
|
if err := te.listener.TaskStarted(ctx, task.Uuid); err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user