Apache Solr open-source search software
SOLR-6650: disabled by default
Timothy Potter14d27294e98a
diff --git a/solr/core/src/java/org/apache/solr/core/SolrConfig.java b/solr/core/src/java/org/apache/solr/core/SolrConfig.javaindex 8a51dce1d75..a690f86c6ed 100644--- a/solr/core/src/java/org/apache/solr/core/SolrConfig.java+++ b/solr/core/src/java/org/apache/solr/core/SolrConfig.java@@ -241,7 +241,7 @@ public class SolrConfig extends Config {jmxConfig = new JmxConfiguration(false, null, null, null);}maxWarmingSearchers = getInt("query/maxWarmingSearchers",Integer.MAX_VALUE);- slowQueryThresholdMillis = getInt("query/slowQueryThresholdMillis", 1000);+ slowQueryThresholdMillis = getInt("query/slowQueryThresholdMillis", -1);loadPluginInfo(SolrRequestHandler.class,"requestHandler",REQUIRE_NAME, REQUIRE_CLASS, MULTI_OK);diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.javaindex 81226b5519f..28592845ab4 100644--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java@@ -666,7 +666,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable {this.solrConfig = null;this.startTime = System.currentTimeMillis();this.maxWarmingSearchers = 2; // we don't have a config yet, just pick a number.- this.slowQueryThresholdMillis = 1000;+ this.slowQueryThresholdMillis = -1;this.resourceLoader = null;this.updateHandler = null;this.isReloaded = true;@@ -1989,10 +1989,12 @@ public final class SolrCore implements SolrInfoMBean, Closeable {if (rsp.getToLog().size() > 0) {if (log.isInfoEnabled()) {log.info(rsp.getToLogAsString(logid));- } else if (log.isWarnEnabled()) {+ }++ if (log.isWarnEnabled()) {final int qtime = (int)(rsp.getEndTime() - req.getStartTime());- if (qtime >= slowQueryThresholdMillis) {- log.warn(rsp.getToLogAsString(logid));+ if (slowQueryThresholdMillis >= 0 && qtime >= slowQueryThresholdMillis) {+ log.warn("slow: " + rsp.getToLogAsString(logid));}}}diff --git a/solr/core/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.javaindex c660b2f8c1c..d127fed8940 100644--- a/solr/core/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.java+++ b/solr/core/src/java/org/apache/solr/update/processor/LogUpdateProcessorFactory.java@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;public class LogUpdateProcessorFactory extends UpdateRequestProcessorFactory implements UpdateRequestProcessorFactory.RunAlways {int maxNumToLog = 10;- int slowUpdateThresholdMillis = 1000;+ int slowUpdateThresholdMillis = -1;@Overridepublic void init( final NamedList args ) {if( args != null ) {@@ -186,10 +186,12 @@ class LogUpdateProcessor extends UpdateRequestProcessor {if (log.isInfoEnabled()) {log.info(getLogStringAndClearRspToLog());- } else if (log.isWarnEnabled()) {+ }++ if (log.isWarnEnabled()) {long elapsed = rsp.getEndTime() - req.getStartTime();- if (elapsed >= slowUpdateThresholdMillis) {- log.warn(getLogStringAndClearRspToLog());+ if (slowUpdateThresholdMillis >= 0 && elapsed >= slowUpdateThresholdMillis) {+ log.warn("slow: " + getLogStringAndClearRspToLog());}}}diff --git a/solr/example/solr/collection1/conf/solrconfig.xml b/solr/example/solr/collection1/conf/solrconfig.xmlindex d3aac83aeb5..087aeec3922 100755--- a/solr/example/solr/collection1/conf/solrconfig.xml+++ b/solr/example/solr/collection1/conf/solrconfig.xml@@ -489,12 +489,8 @@useful to be able to set a latency threshold above which a requestis considered "slow" and log that request at WARN level so we caneasily identify slow queries.-- This setting only applies if the logger for the- org.apache.solr.core.SolrCore is set to WARN or greater.--->- <slowQueryThresholdMillis>1000</slowQueryThresholdMillis>+ <slowQueryThresholdMillis>-1</slowQueryThresholdMillis><!-- Solr Internal Query Caches