Skip to content

Commit a9b2dee

Browse files
committed
Search: fixed log to print throwable correctly
In TransportSearchTypeAction one of the logger calls was passing the throwable in as a parameter for the message rather than a throwable to be printed as a stack trace. This change fixes it so the throwable is printed properly
1 parent 7b643b1 commit a9b2dee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/main/java/org/elasticsearch/action/search/type/TransportSearchTypeAction.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
import org.elasticsearch.ElasticsearchIllegalStateException;
2525
import org.elasticsearch.action.ActionListener;
2626
import org.elasticsearch.action.NoShardAvailableActionException;
27-
import org.elasticsearch.action.search.*;
27+
import org.elasticsearch.action.search.ReduceSearchPhaseException;
28+
import org.elasticsearch.action.search.SearchAction;
29+
import org.elasticsearch.action.search.SearchPhaseExecutionException;
30+
import org.elasticsearch.action.search.SearchRequest;
31+
import org.elasticsearch.action.search.SearchResponse;
32+
import org.elasticsearch.action.search.ShardSearchFailure;
2833
import org.elasticsearch.action.support.ActionFilters;
2934
import org.elasticsearch.action.support.TransportAction;
3035
import org.elasticsearch.action.support.TransportActions;
@@ -227,7 +232,7 @@ void onFirstPhaseResult(final int shardIndex, @Nullable ShardRouting shard, @Nul
227232
}
228233
if (successfulOps.get() == 0) {
229234
if (logger.isDebugEnabled()) {
230-
logger.debug("All shards failed for phase: [{}]", firstPhaseName(), t);
235+
logger.debug("All shards failed for phase: [{}]", t, firstPhaseName());
231236
}
232237
// no successful ops, raise an exception
233238
raiseEarlyFailure(new SearchPhaseExecutionException(firstPhaseName(), "all shards failed", buildShardFailures()));

0 commit comments

Comments
 (0)