Fix additional exception logging call

This commit modifies an exception logging calls to use a parameterized
message from Log4j.

Original commit: elastic/x-pack-elasticsearch@7b0df7d056
This commit is contained in:
Jason Tedor 2016-08-31 23:16:07 -04:00
parent 7a3d416558
commit b29cdc0877
1 changed files with 3 additions and 1 deletions

View File

@ -115,7 +115,9 @@ public class ActionWrapper implements ToXContent {
new Action.Result.ConditionFailed(action.type(), "condition not met. skipping"));
}
} catch (RuntimeException e) {
action.logger().error("failed to execute action [{}/{}]. failed to execute condition", e, ctx.watch().id(), id);
action.logger().error(
(Supplier<?>) () -> new ParameterizedMessage(
"failed to execute action [{}/{}]. failed to execute condition", ctx.watch().id(), id), e);
return new ActionWrapper.Result(id, new Action.Result.ConditionFailed(action.type(),
"condition failed. skipping: {}", e.getMessage()));
}