From 0ef19262ce6fd6f6ff3cbe068fe8189a91f7b7ca Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Tue, 14 Nov 2023 12:22:35 +0100 Subject: [PATCH] Log the full remediation and alert error (#1643) We didn't really log the error it seems, it was visible in the status and in the database, but having it in logs is useful, too. If the error we pass is `nil`, the log message would be `Info` instead. --- internal/engine/executor.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/engine/executor.go b/internal/engine/executor.go index 0caaad7cfb..36f09f1bcf 100644 --- a/internal/engine/executor.go +++ b/internal/engine/executor.go @@ -263,13 +263,13 @@ func logEval( evalLog.Err(params.GetEvalErr()).Msg("result - evaluation") // log remediation - logger.Debug(). + logger.Err(params.GetActionsErr().RemediateErr). Str("action", "remediate"). Str("action_status", string(evalerrors.ErrorAsRemediationStatus(params.GetActionsErr().RemediateErr))). Msg("result - action") // log alert - logger.Debug(). + logger.Err(params.GetActionsErr().AlertErr). Str("action", "alert"). Str("action_status", string(evalerrors.ErrorAsAlertStatus(params.GetActionsErr().AlertErr))). Msg("result - action")