Skip to content

Commit

Permalink
Splitter WARN log in WARN and DEBUG with the full stacktrace
Browse files Browse the repository at this point in the history
  • Loading branch information
andsel committed Aug 8, 2024
1 parent 32cec8b commit ee1837a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
package org.logstash.execution;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.file.FileStore;
import java.nio.file.Files;
import java.nio.file.Paths;
Expand Down Expand Up @@ -178,7 +180,13 @@ public final class LogErrorEvaluationListener implements ConditionalEvaluationLi
@Override
public void notify(ConditionalEvaluationError err) {
lastErrorEvaluationReceived = err.getMessage();
LOGGER.warn("Error in condition evaluation with event {}", err.failedEvent().getField("[event][original]"), err);
LOGGER.warn("Error in condition evaluation with error {} on event {}", lastErrorEvaluationReceived, err.failedEvent().getField("[event][original]"));
try (StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw)) {
err.printStackTrace(pw);
LOGGER.debug("{}", sw);
} catch (IOException ioex) {
LOGGER.warn("Invalid operation on closing internal resources", ioex);
}
}
}

Expand Down

0 comments on commit ee1837a

Please sign in to comment.