Skip to content

Commit

Permalink
SOLR-16044: SlowRequest logging disabled if SolrCore logger set to ER…
Browse files Browse the repository at this point in the history
…ROR (#1907)

(cherry picked from commit ca4692b)
  • Loading branch information
janhoy committed Sep 10, 2023
1 parent 5cc252f commit 5d2d59a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ Bug Fixes

* SOLR-16955: Tracing v2 apis breaks SecurityConfHandler (Alex Deparvu, David Smiley)

* SOLR-16044: SlowRequest logging is no longer disabled if SolrCore logger set to ERROR (janhoy, hossman)

Dependency Upgrades
---------------------

Expand Down
2 changes: 1 addition & 1 deletion solr/core/src/java/org/apache/solr/core/SolrCore.java
Original file line number Diff line number Diff line change
Expand Up @@ -2901,7 +2901,7 @@ public void execute(SolrRequestHandler handler, SolrQueryRequest req, SolrQueryR
}

/* slowQueryThresholdMillis defaults to -1 in SolrConfig -- not enabled.*/
if (log.isWarnEnabled() && slowQueryThresholdMillis >= 0) {
if (slowLog.isWarnEnabled() && slowQueryThresholdMillis >= 0) {
final long qtime = (long) (req.getRequestTimer().getTime());
if (qtime >= slowQueryThresholdMillis) {
slowLog.warn("slow: {}", rsp.getToLogAsString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void filter(
response.responseHeader.qTime);

/* slowQueryThresholdMillis defaults to -1 in SolrConfig -- not enabled.*/
if (log.isWarnEnabled()
if (slowCoreRequestLogger.isWarnEnabled()
&& solrConfig != null
&& solrConfig.slowQueryThresholdMillis >= 0
&& response.responseHeader.qTime >= solrConfig.slowQueryThresholdMillis) {
Expand Down

0 comments on commit 5d2d59a

Please sign in to comment.