From 31660fd22da68dd5908a6d86b870e5472585d094 Mon Sep 17 00:00:00 2001 From: hitesh Date: Wed, 29 Nov 2023 14:13:06 -0800 Subject: [PATCH] Disabling start of get request log --- .../solr/handler/component/SearchHandler.java | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java index 8795a4fcf3c..233a3b7d247 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java @@ -404,23 +404,25 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw rb.isDistrib = isDistrib(req); tagRequestWithRequestId(rb); - if (isShard) { - // log a simple message on start - log.info("Start Forwarded Search Query"); - SolrParams filteredParams = removeVerboseParams(req.getParams()); - rsp.getToLog() - .asShallowMap(false) - .put("params", "{" + filteredParams + "}"); // replace "params" with the filtered version - } else { - // Then it is the first time this req hitting Solr - not a req distributed by another higher - // level req. - // We have to log the query here as - // 1. It's useful to know the query before the processing start in case if the query stalls - // 2. The existing logging in SolrCore does not contain the query as query construction - // happens after the log - // entries are added to rsp.toLog - if (log.isInfoEnabled()) { - log.info("Start External Search Query: {}", req.getParamString()); + if (req.getPath().contains("select")) { + if (isShard) { + // log a simple message on start + log.info("Start Forwarded Search Query"); + SolrParams filteredParams = removeVerboseParams(req.getParams()); + rsp.getToLog() + .asShallowMap(false) + .put("params", "{" + filteredParams + "}"); // replace "params" with the filtered version + } else { + // Then it is the first time this req hitting Solr - not a req distributed by another higher + // level req. + // We have to log the query here as + // 1. It's useful to know the query before the processing start in case if the query stalls + // 2. The existing logging in SolrCore does not contain the query as query construction + // happens after the log + // entries are added to rsp.toLog + if (log.isInfoEnabled()) { + log.info("Start External Search Query: {}", req.getParamString()); + } } }