Skip to content

Commit

Permalink
Log the full remediation and alert error (mindersec#1643)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhrozek authored Nov 14, 2023
1 parent 2c80883 commit 0ef1926
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/engine/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0ef1926

Please sign in to comment.