diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 97eb8bd2895..94f30c787d8 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -167,6 +167,8 @@ Other Changes * SOLR-9544: Allow ObjectReleaseTracker more time to check for asynchronously closing resources (Alan Woodward) +* SOLR-6677: Reduced logging during Solr startup, moved more logs to DEBUG level (janhoy, Shawn Heisey) + ================== 6.2.1 ================== Bug Fixes diff --git a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java index 5b7ad1b5a53..6a46843c60c 100644 --- a/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java +++ b/solr/core/src/java/org/apache/solr/core/CachingDirectoryFactory.java @@ -350,7 +350,7 @@ public abstract class CachingDirectoryFactory extends DirectoryFactory { CacheValue newCacheValue = new CacheValue(fullPath, directory); byDirectoryCache.put(directory, newCacheValue); byPathCache.put(fullPath, newCacheValue); - log.info("return new directory for " + fullPath); + log.debug("return new directory for " + fullPath); success = true; } finally { if (!success) { diff --git a/solr/core/src/java/org/apache/solr/core/ConfigSetProperties.java b/solr/core/src/java/org/apache/solr/core/ConfigSetProperties.java index ca768edc124..004b166f818 100644 --- a/solr/core/src/java/org/apache/solr/core/ConfigSetProperties.java +++ b/solr/core/src/java/org/apache/solr/core/ConfigSetProperties.java @@ -51,7 +51,7 @@ public class ConfigSetProperties { try { reader = new InputStreamReader(loader.openResource(name), StandardCharsets.UTF_8); } catch (SolrResourceNotFoundException ex) { - log.info("Did not find ConfigSet properties, assuming default properties: " + ex.getMessage()); + log.debug("Did not find ConfigSet properties, assuming default properties: " + ex.getMessage()); return null; } catch (Exception ex) { throw new SolrException(ErrorCode.SERVER_ERROR, "Unable to load reader for ConfigSet properties: " + name, ex); diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java index 2a7e516cf88..fa8a8c0945e 100644 --- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java +++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java @@ -189,7 +189,7 @@ public class CoreContainer { // private ClientConnectionManager clientConnectionManager = new PoolingClientConnectionManager(); { - log.info("New CoreContainer " + System.identityHashCode(this)); + log.debug("New CoreContainer " + System.identityHashCode(this)); } /** @@ -273,7 +273,7 @@ public class CoreContainer { // Read and pass the authorization context to the plugin authorizationPlugin.plugin.init(authorizationConf); } else { - log.info("Security conf doesn't exist. Skipping setup for authorization module."); + log.debug("Security conf doesn't exist. Skipping setup for authorization module."); } this.authorizationPlugin = authorizationPlugin; if (old != null) { @@ -302,7 +302,7 @@ public class CoreContainer { log.info("Authentication plugin class obtained from system property '" + AUTHENTICATION_PLUGIN_PROP + "': " + pluginClassName); } else { - log.info("No authentication plugin used."); + log.debug("No authentication plugin used."); } SecurityPluginHolder old = authenticationPlugin; SecurityPluginHolder authenticationPlugin = null; @@ -335,7 +335,7 @@ public class CoreContainer { // The default http client of the core container's shardHandlerFactory has already been created and // configured using the default httpclient configurer. We need to reconfigure it using the plugin's // http client configurer to set it up for internode communication. - log.info("Reconfiguring HttpClient settings."); + log.debug("Reconfiguring HttpClient settings."); SolrHttpClientContextBuilder httpClientBuilder = new SolrHttpClientContextBuilder(); if (builder.getCredentialsProviderProvider() != null) { @@ -431,7 +431,7 @@ public class CoreContainer { * Load the cores defined for this CoreContainer */ public void load() { - log.info("Loading cores into CoreContainer [instanceDir={}]", loader.getInstancePath()); + log.debug("Loading cores into CoreContainer [instanceDir={}]", loader.getInstancePath()); // add the sharedLib to the shared resource loader before initializing cfg based plugins String libDir = cfg.getSharedLibDirectory(); @@ -742,14 +742,14 @@ public class CoreContainer { coreInitFailures.remove(name); if( old == null || old == core) { - log.info( "registering core: "+name ); + log.debug( "registering core: "+name ); if (registerInZk) { zkSys.registerInZk(core, false); } return null; } else { - log.info( "replacing core: "+name ); + log.debug( "replacing core: "+name ); old.close(); if (registerInZk) { zkSys.registerInZk(core, false); diff --git a/solr/core/src/java/org/apache/solr/core/CorePropertiesLocator.java b/solr/core/src/java/org/apache/solr/core/CorePropertiesLocator.java index 30038c5dfca..b37402b97e2 100644 --- a/solr/core/src/java/org/apache/solr/core/CorePropertiesLocator.java +++ b/solr/core/src/java/org/apache/solr/core/CorePropertiesLocator.java @@ -35,6 +35,7 @@ import java.util.List; import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.stream.Collectors; import com.google.common.collect.Lists; import org.apache.solr.common.SolrException; @@ -54,7 +55,7 @@ public class CorePropertiesLocator implements CoresLocator { public CorePropertiesLocator(Path coreDiscoveryRoot) { this.rootDirectory = coreDiscoveryRoot; - logger.info("Config-defined core root directory: {}", this.rootDirectory); + logger.debug("Config-defined core root directory: {}", this.rootDirectory); } @Override @@ -122,7 +123,7 @@ public class CorePropertiesLocator implements CoresLocator { @Override public List discover(final CoreContainer cc) { - logger.info("Looking for core definitions underneath {}", rootDirectory); + logger.debug("Looking for core definitions underneath {}", rootDirectory); final List cds = Lists.newArrayList(); try { Set options = new HashSet<>(); @@ -133,7 +134,7 @@ public class CorePropertiesLocator implements CoresLocator { public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (file.getFileName().toString().equals(PROPERTIES_FILENAME)) { CoreDescriptor cd = buildCoreDescriptor(file, cc); - logger.info("Found core {} in {}", cd.getName(), cd.getInstanceDir()); + logger.debug("Found core {} in {}", cd.getName(), cd.getInstanceDir()); cds.add(cd); return FileVisitResult.SKIP_SIBLINGS; } @@ -155,7 +156,10 @@ public class CorePropertiesLocator implements CoresLocator { } catch (IOException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Couldn't walk file tree under " + this.rootDirectory, e); } - logger.info("Found {} core definitions", cds.size()); + logger.info("Found {} core definitions underneath {}", cds.size(), rootDirectory); + if (cds.size() > 0) { + logger.info("Cores are: {}", cds.stream().map(CoreDescriptor::getName).collect(Collectors.toList())); + } return cds; } diff --git a/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java b/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java index 57bde93decd..a5a27dc24d8 100644 --- a/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java +++ b/solr/core/src/java/org/apache/solr/core/JmxMonitoredMap.java @@ -73,7 +73,7 @@ import static org.apache.solr.common.params.CommonParams.NAME; */ public class JmxMonitoredMap extends ConcurrentHashMap { - private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); + private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); // set to true to use cached statistics NamedLists between getMBeanInfo calls to work // around over calling getStatistics on MBeanInfos when iterating over all attributes (SOLR-6586) @@ -108,11 +108,11 @@ public class JmxMonitoredMap extends } if (servers == null || servers.isEmpty()) { - LOG.info("No JMX servers found, not exposing Solr information with JMX."); + log.debug("No JMX servers found, not exposing Solr information with JMX."); return; } server = servers.get(0); - LOG.info("JMX monitoring is enabled. Adding Solr mbeans to JMX Server: " + log.info("JMX monitoring is enabled. Adding Solr mbeans to JMX Server: " + server); } else { try { @@ -122,7 +122,7 @@ public class JmxMonitoredMap extends .newJMXConnectorServer(new JMXServiceURL(jmxConfig.serviceUrl), null, server); connector.start(); - LOG.info("JMX monitoring is enabled at " + jmxConfig.serviceUrl); + log.info("JMX monitoring is enabled at " + jmxConfig.serviceUrl); } catch (Exception e) { // Release the reference server = null; @@ -145,7 +145,7 @@ public class JmxMonitoredMap extends ObjectName instance = new ObjectName(jmxRootName + ":*"); objectNames = server.queryNames(instance, exp); } catch (Exception e) { - LOG.warn("Exception querying for mbeans", e); + log.warn("Exception querying for mbeans", e); } if (objectNames != null) { @@ -153,7 +153,7 @@ public class JmxMonitoredMap extends try { server.unregisterMBean(name); } catch (Exception e) { - LOG.warn("Exception un-registering mbean {}", name, e); + log.warn("Exception un-registering mbean {}", name, e); } } } @@ -181,7 +181,7 @@ public class JmxMonitoredMap extends SolrDynamicMBean mbean = new SolrDynamicMBean(coreHashCode, infoBean, useCachedStatsBetweenGetMBeanInfoCalls); server.registerMBean(mbean, name); } catch (Exception e) { - LOG.warn( "Failed to register info bean: " + key, e); + log.warn( "Failed to register info bean: " + key, e); } } @@ -201,7 +201,7 @@ public class JmxMonitoredMap extends try { unregister((String) key, infoBean); } catch (RuntimeException e) { - LOG.warn( "Failed to unregister info bean: " + key, e); + log.warn( "Failed to unregister info bean: " + key, e); } } return super.remove(key); @@ -319,7 +319,7 @@ public class JmxMonitoredMap extends } catch (Exception e) { // don't log issue if the core is closing if (!(SolrException.getRootCause(e) instanceof AlreadyClosedException)) - LOG.warn("Could not getStatistics on info bean {}", infoBean.getName(), e); + log.warn("Could not getStatistics on info bean {}", infoBean.getName(), e); } MBeanAttributeInfo[] attrInfoArr = attrInfoList @@ -395,7 +395,7 @@ public class JmxMonitoredMap extends try { list.add(new Attribute(attribute, getAttribute(attribute))); } catch (Exception e) { - LOG.warn("Could not get attribute " + attribute); + log.warn("Could not get attribute " + attribute); } } diff --git a/solr/core/src/java/org/apache/solr/core/PluginBag.java b/solr/core/src/java/org/apache/solr/core/PluginBag.java index 412bd9395f1..343f988a4ca 100644 --- a/solr/core/src/java/org/apache/solr/core/PluginBag.java +++ b/solr/core/src/java/org/apache/solr/core/PluginBag.java @@ -29,6 +29,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import java.util.stream.Collectors; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -116,10 +117,10 @@ public class PluginBag implements AutoCloseable { PluginHolder createPlugin(PluginInfo info) { if ("true".equals(String.valueOf(info.attributes.get("runtimeLib")))) { - log.info(" {} : '{}' created with runtimeLib=true ", meta.getCleanTag(), info.name); + log.debug(" {} : '{}' created with runtimeLib=true ", meta.getCleanTag(), info.name); return new LazyPluginHolder<>(meta, info, core, core.getMemClassLoader()); } else if ("lazy".equals(info.attributes.get("startup")) && meta.options.contains(SolrConfig.PluginOpts.LAZY)) { - log.info("{} : '{}' created with startup=lazy ", meta.getCleanTag(), info.name); + log.debug("{} : '{}' created with startup=lazy ", meta.getCleanTag(), info.name); return new LazyPluginHolder(meta, info, core, core.getResourceLoader()); } else { T inst = core.createInstance(info.className, (Class) meta.clazz, meta.getCleanTag(), null, core.getResourceLoader()); @@ -228,6 +229,10 @@ public class PluginBag implements AutoCloseable { PluginHolder old = put(name, o); if (old != null) log.warn("Multiple entries of {} with name {}", meta.getCleanTag(), name); } + if (infos.size() > 0) { // Aggregate logging + log.info("[{}] Initialized {} plugins of type {}: {}", solrCore.getName(), infos.size(), meta.getCleanTag(), + infos.stream().map(i -> i.name).collect(Collectors.toList())); + } for (Map.Entry e : defaults.entrySet()) { if (!contains(e.getKey())) { put(e.getKey(), new PluginHolder(null, e.getValue())); diff --git a/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java b/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java index c575ecbca10..2b69d513b01 100644 --- a/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java +++ b/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java @@ -86,10 +86,10 @@ public class SchemaCodecFactory extends CodecFactory implements SolrCoreAware { "Invalid compressionMode: '" + compressionModeStr + "'. Value must be one of " + Arrays.toString(Mode.values())); } - log.info("Using compressionMode: " + compressionMode); + log.debug("Using compressionMode: " + compressionMode); } else { compressionMode = SOLR_DEFAULT_COMPRESSION_MODE; - log.info("Using default compressionMode: " + compressionMode); + log.debug("Using default compressionMode: " + compressionMode); } codec = new Lucene62Codec(compressionMode) { @Override diff --git a/solr/core/src/java/org/apache/solr/core/SolrConfig.java b/solr/core/src/java/org/apache/solr/core/SolrConfig.java index 0c9b96e0819..a661f6c7cb0 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrConfig.java +++ b/solr/core/src/java/org/apache/solr/core/SolrConfig.java @@ -228,7 +228,7 @@ public class SolrConfig extends Config implements MapSerializable { indexConfig = new SolrIndexConfig(this, "indexConfig", null); booleanQueryMaxClauseCount = getInt("query/maxBooleanClauses", BooleanQuery.getMaxClauseCount()); - log.info("Using Lucene MatchVersion: " + luceneMatchVersion); + log.info("Using Lucene MatchVersion: {}", luceneMatchVersion); // Warn about deprecated / discontinued parameters // boolToFilterOptimizer has had no effect since 3.1 @@ -327,7 +327,7 @@ public class SolrConfig extends Config implements MapSerializable { } solrRequestParsers = new SolrRequestParsers(this); - log.info("Loaded SolrConfig: " + name); + log.info("Loaded SolrConfig: {}", name); } public static final List plugins = ImmutableList.builder() @@ -409,7 +409,7 @@ public class SolrConfig extends Config implements MapSerializable { int version = 0; // will be always 0 for file based resourceLoader if (in instanceof ZkSolrResourceLoader.ZkByteArrayInputStream) { version = ((ZkSolrResourceLoader.ZkByteArrayInputStream) in).getStat().getVersion(); - log.info("config overlay loaded . version : {} ", version); + log.debug("Config overlay loaded. version : {} ", version); } isr = new InputStreamReader(in, StandardCharsets.UTF_8); Map m = (Map) ObjectBuilder.getVal(new JSONParser(isr)); @@ -750,7 +750,7 @@ public class SolrConfig extends Config implements MapSerializable { NodeList nodes = (NodeList) evaluate("lib", XPathConstants.NODESET); if (nodes == null || nodes.getLength() == 0) return; - log.info("Adding specified lib dirs to ClassLoader"); + log.debug("Adding specified lib dirs to ClassLoader"); SolrResourceLoader loader = getResourceLoader(); List urls = new ArrayList<>(); @@ -931,7 +931,7 @@ public class SolrConfig extends Config implements MapSerializable { public RequestParams refreshRequestParams() { requestParams = RequestParams.getFreshRequestParams(getResourceLoader(), requestParams); - log.info("current version of requestparams : {}", requestParams.getZnodeVersion()); + log.debug("current version of requestparams : {}", requestParams.getZnodeVersion()); return requestParams; } diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java index c837fba9956..75d394ab44c 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrCore.java +++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java @@ -439,11 +439,11 @@ public final class SolrCore implements SolrInfoMBean, Closeable { if ("firstSearcher".equals(event)) { SolrEventListener obj = createInitInstance(info, clazz, label, null); firstSearcherListeners.add(obj); - log.info("[{}] Added SolrEventListener for firstSearcher: [{}]", logid, obj); + log.debug("[{}] Added SolrEventListener for firstSearcher: [{}]", logid, obj); } else if ("newSearcher".equals(event)) { SolrEventListener obj = createInitInstance(info, clazz, label, null); newSearcherListeners.add(obj); - log.info("[{}] Added SolrEventListener for newSearcher: [{}]", logid, obj); + log.debug("[{}] Added SolrEventListener for newSearcher: [{}]", logid, obj); } } } @@ -521,13 +521,13 @@ public final class SolrCore implements SolrInfoMBean, Closeable { final PluginInfo info = solrConfig.getPluginInfo(DirectoryFactory.class.getName()); final DirectoryFactory dirFactory; if (info != null) { - log.info(info.className); + log.debug(info.className); dirFactory = getResourceLoader().newInstance(info.className, DirectoryFactory.class); // allow DirectoryFactory instances to access the CoreContainer dirFactory.initCoreContainer(getCoreDescriptor().getCoreContainer()); dirFactory.init(info.initArgs); } else { - log.info("solr.NRTCachingDirectoryFactory"); + log.debug("solr.NRTCachingDirectoryFactory"); dirFactory = new NRTCachingDirectoryFactory(); dirFactory.initCoreContainer(getCoreDescriptor().getCoreContainer()); } @@ -851,7 +851,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable { log.debug("Registering JMX bean [{}] from directory factory.", bean.getName()); // Not worried about concurrency, so no reason to use putIfAbsent if (infoRegistry.containsKey(bean.getName())){ - log.info("Ignoring JMX bean [{}] due to name conflict.", bean.getName()); + log.debug("Ignoring JMX bean [{}] due to name conflict.", bean.getName()); } else { infoRegistry.put(bean.getName(), bean); } @@ -959,7 +959,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable { if (config.jmxConfig.enabled) { return new JmxMonitoredMap(name, String.valueOf(this.hashCode()), config.jmxConfig); } else { - log.info("JMX monitoring not detected for core: " + name); + log.debug("JMX monitoring not detected for core: " + name); return new ConcurrentHashMap<>(); } } @@ -1074,9 +1074,9 @@ public final class SolrCore implements SolrInfoMBean, Closeable { if (pluginInfo != null && pluginInfo.className != null && pluginInfo.className.length() > 0) { cache = createInitInstance(pluginInfo, StatsCache.class, null, LocalStatsCache.class.getName()); - log.info("Using statsCache impl: " + cache.getClass().getName()); + log.debug("Using statsCache impl: " + cache.getClass().getName()); } else { - log.info("Using default statsCache cache: " + LocalStatsCache.class.getName()); + log.debug("Using default statsCache cache: " + LocalStatsCache.class.getName()); cache = new LocalStatsCache(); } return cache; @@ -1099,7 +1099,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable { def = map.get(null); } if (def == null) { - log.info("no updateRequestProcessorChain defined as default, creating implicit default"); + log.debug("no updateRequestProcessorChain defined as default, creating implicit default"); // construct the default chain UpdateRequestProcessorFactory[] factories = new UpdateRequestProcessorFactory[]{ new LogUpdateProcessorFactory(), @@ -1645,7 +1645,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable { // but log a message about it to minimize confusion newestSearcher.incref(); - log.info("SolrIndexSearcher has not changed - not re-opening: " + newestSearcher.get().getName()); + log.debug("SolrIndexSearcher has not changed - not re-opening: " + newestSearcher.get().getName()); return newestSearcher; } // ELSE: open a new searcher against the old reader... @@ -2633,7 +2633,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable { return false; } if (stat.getVersion() > currentVersion) { - log.info(zkPath+" is stale will need an update from {} to {}", currentVersion,stat.getVersion()); + log.debug(zkPath+" is stale will need an update from {} to {}", currentVersion,stat.getVersion()); return true; } return false; @@ -2654,7 +2654,7 @@ public final class SolrCore implements SolrInfoMBean, Closeable { final String coreName = getName(); if (myDirFactory != null && myDataDir != null && myIndexDir != null) { Thread cleanupThread = new Thread(() -> { - log.info("Looking for old index directories to cleanup for core {} in {}", coreName, myDataDir); + log.debug("Looking for old index directories to cleanup for core {} in {}", coreName, myDataDir); try { myDirFactory.cleanupOldIndexDirectories(myDataDir, myIndexDir); } catch (Exception exc) { diff --git a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java index 238d38727c0..4bf25aa99b4 100644 --- a/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java +++ b/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java @@ -41,9 +41,12 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Properties; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentSkipListSet; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; @@ -89,6 +92,8 @@ public class SolrResourceLoader implements ResourceLoader,Closeable "update.processor.", "util.", "spelling.", "handler.component.", "handler.dataimport.", "spelling.suggest.", "spelling.suggest.fst.", "rest.schema.analysis.", "security.","handler.admin." }; + private static final java.lang.String SOLR_CORE_NAME = "solr.core.name"; + private static Set loggedOnce = new ConcurrentSkipListSet<>(); protected URLClassLoader classLoader; private final Path instanceDir; @@ -150,10 +155,10 @@ public class SolrResourceLoader implements ResourceLoader,Closeable public SolrResourceLoader(Path instanceDir, ClassLoader parent, Properties coreProperties) { if (instanceDir == null) { this.instanceDir = SolrResourceLoader.locateSolrHome().toAbsolutePath().normalize(); - log.info("new SolrResourceLoader for deduced Solr Home: '{}'", this.instanceDir); + log.debug("new SolrResourceLoader for deduced Solr Home: '{}'", this.instanceDir); } else{ this.instanceDir = instanceDir.toAbsolutePath().normalize(); - log.info("new SolrResourceLoader for directory: '{}'", this.instanceDir); + log.debug("new SolrResourceLoader for directory: '{}'", this.instanceDir); } if (parent == null) @@ -193,6 +198,12 @@ public class SolrResourceLoader implements ResourceLoader,Closeable if (newLoader != classLoader) { this.classLoader = newLoader; } + log.info("[{}] Added {} libs to classloader, from paths: {}", + getCoreProperties().getProperty(SOLR_CORE_NAME), urls.size(), urls.stream() + .map(u -> u.getPath().substring(0,u.getPath().lastIndexOf("/"))) + .sorted() + .distinct() + .collect(Collectors.toList())); } /** @@ -232,7 +243,7 @@ public class SolrResourceLoader implements ResourceLoader,Closeable allURLs.addAll(Arrays.asList(oldLoader.getURLs())); allURLs.addAll(urls); for (URL url : urls) { - log.info("Adding '{}' to classloader", url.toString()); + log.debug("Adding '{}' to classloader", url.toString()); } ClassLoader oldParent = oldLoader.getParent(); @@ -754,11 +765,11 @@ public class SolrResourceLoader implements ResourceLoader,Closeable try { Context c = new InitialContext(); home = (String)c.lookup("java:comp/env/"+project+"/home"); - log.info("Using JNDI solr.home: "+home ); + logOnceInfo("home_using_jndi", "Using JNDI solr.home: "+home ); } catch (NoInitialContextException e) { - log.info("JNDI not configured for "+project+" (NoInitialContextEx)"); + log.debug("JNDI not configured for "+project+" (NoInitialContextEx)"); } catch (NamingException e) { - log.info("No /"+project+"/home in JNDI"); + log.debug("No /"+project+"/home in JNDI"); } catch( RuntimeException ex ) { log.warn("Odd RuntimeException while testing for JNDI: " + ex.getMessage()); } @@ -768,18 +779,26 @@ public class SolrResourceLoader implements ResourceLoader,Closeable String prop = project + ".solr.home"; home = System.getProperty(prop); if( home != null ) { - log.info("using system property "+prop+": " + home ); + logOnceInfo("home_using_sysprop", "Using system property "+prop+": " + home ); } } // if all else fails, try if( home == null ) { home = project + '/'; - log.info(project + " home defaulted to '" + home + "' (could not find system property or JNDI)"); + logOnceInfo("home_default", project + " home defaulted to '" + home + "' (could not find system property or JNDI)"); } return Paths.get(home); } + // Logs a message only once per startup + private static void logOnceInfo(String key, String msg) { + if (!loggedOnce.contains(key)) { + loggedOnce.add(key); + log.info(msg); + } + } + /** * @return the instance path for this resource loader */ diff --git a/solr/core/src/java/org/apache/solr/core/snapshots/SolrSnapshotMetaDataManager.java b/solr/core/src/java/org/apache/solr/core/snapshots/SolrSnapshotMetaDataManager.java index 26cbe215f70..54feddc3215 100644 --- a/solr/core/src/java/org/apache/solr/core/snapshots/SolrSnapshotMetaDataManager.java +++ b/solr/core/src/java/org/apache/solr/core/snapshots/SolrSnapshotMetaDataManager.java @@ -358,7 +358,7 @@ public class SolrSnapshotMetaDataManager { * Reads the snapshot meta-data information from the given {@link Directory}. */ private synchronized void loadFromSnapshotMetadataFile() throws IOException { - log.info("Loading from snapshot metadata file..."); + log.debug("Loading from snapshot metadata file..."); long genLoaded = -1; IOException ioe = null; List snapshotFiles = new ArrayList<>(); diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java index bc5927fc336..d1e1ed5d468 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java +++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java @@ -139,7 +139,7 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory implements org. this.keepAliveTime = getParameter(args, MAX_THREAD_IDLE_TIME, keepAliveTime,sb); this.queueSize = getParameter(args, INIT_SIZE_OF_QUEUE, queueSize,sb); this.accessPolicy = getParameter(args, INIT_FAIRNESS_POLICY, accessPolicy,sb); - log.info("created with {}",sb); + log.debug("created with {}",sb); // magic sysprop to make tests reproducible: set by SolrTestCaseJ4. String v = System.getProperty("tests.shardhandler.randomSeed"); diff --git a/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java b/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java index a75857cca48..d6a51705a31 100644 --- a/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java +++ b/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java @@ -111,7 +111,7 @@ public class XMLLoader extends ContentStreamLoader { xsltCacheLifetimeSeconds = XSLT_CACHE_DEFAULT; if(args != null) { xsltCacheLifetimeSeconds = args.getInt(XSLT_CACHE_PARAM,XSLT_CACHE_DEFAULT); - log.info("xsltCacheLifetimeSeconds=" + xsltCacheLifetimeSeconds); + log.debug("xsltCacheLifetimeSeconds=" + xsltCacheLifetimeSeconds); } return this; } diff --git a/solr/core/src/java/org/apache/solr/logging/LogWatcher.java b/solr/core/src/java/org/apache/solr/logging/LogWatcher.java index 3ba74217c12..c5105902826 100644 --- a/solr/core/src/java/org/apache/solr/logging/LogWatcher.java +++ b/solr/core/src/java/org/apache/solr/logging/LogWatcher.java @@ -127,7 +127,7 @@ public abstract class LogWatcher { public static LogWatcher newRegisteredLogWatcher(LogWatcherConfig config, SolrResourceLoader loader) { if (!config.isEnabled()) { - log.info("A LogWatcher is not enabled"); + log.debug("A LogWatcher is not enabled"); return null; } @@ -135,7 +135,7 @@ public abstract class LogWatcher { if (logWatcher != null) { if (config.getWatcherSize() > 0) { - log.info("Registering Log Listener [{}]", logWatcher.getName()); + log.debug("Registering Log Listener [{}]", logWatcher.getName()); logWatcher.registerListener(config.asListenerConfig()); } } @@ -150,7 +150,7 @@ public abstract class LogWatcher { try { slf4jImpl = StaticLoggerBinder.getSingleton().getLoggerFactoryClassStr(); - log.info("SLF4J impl is " + slf4jImpl); + log.debug("SLF4J impl is " + slf4jImpl); if (fname == null) { if ("org.slf4j.impl.Log4jLoggerFactory".equals(slf4jImpl)) { fname = "Log4j"; @@ -168,7 +168,7 @@ public abstract class LogWatcher { } if (fname == null) { - log.info("No LogWatcher configured"); + log.debug("No LogWatcher configured"); return null; } diff --git a/solr/core/src/java/org/apache/solr/schema/CurrencyField.java b/solr/core/src/java/org/apache/solr/schema/CurrencyField.java index f2dc3511013..787599a1ccb 100644 --- a/solr/core/src/java/org/apache/solr/schema/CurrencyField.java +++ b/solr/core/src/java/org/apache/solr/schema/CurrencyField.java @@ -787,7 +787,7 @@ class FileExchangeRateProvider implements ExchangeRateProvider { InputStream is = null; Map> tmpRates = new HashMap<>(); try { - log.info("Reloading exchange rates from file "+this.currencyConfigFile); + log.debug("Reloading exchange rates from file "+this.currencyConfigFile); is = loader.openResource(currencyConfigFile); javax.xml.parsers.DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); diff --git a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java index 2cec6d3e406..96ad09dc0a4 100644 --- a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java +++ b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java @@ -537,18 +537,20 @@ public class IndexSchema { throw new SolrException(ErrorCode.SERVER_ERROR, msg); } } - log.info("default search field in schema is "+defaultSearchFieldName); + log.info("[{}] default search field in schema is {}. WARNING: Deprecated, please use 'df' on request instead.", + loader.getCoreProperties().getProperty(SOLR_CORE_NAME), defaultSearchFieldName); } // /schema/solrQueryParser/@defaultOperator expression = stepsToPath(SCHEMA, SOLR_QUERY_PARSER, AT + DEFAULT_OPERATOR); node = (Node) xpath.evaluate(expression, document, XPathConstants.NODE); if (node==null) { - log.debug("using default query parser operator (OR)"); + log.debug("Default query parser operator not set in Schema"); } else { isExplicitQueryParserDefaultOperator = true; queryParserDefaultOperator=node.getNodeValue().trim(); - log.info("query parser default operator is "+queryParserDefaultOperator); + log.info("[{}] query parser default operator is {}. WARNING: Deprecated, please use 'q.op' on request instead.", + loader.getCoreProperties().getProperty(SOLR_CORE_NAME), queryParserDefaultOperator); } // /schema/uniqueKey/text() @@ -577,7 +579,8 @@ public class IndexSchema { } uniqueKeyFieldName=uniqueKeyField.getName(); uniqueKeyFieldType=uniqueKeyField.getType(); - log.info("unique key field: "+uniqueKeyFieldName); + log.info("[{}] unique key field: {}", + loader.getCoreProperties().getProperty(SOLR_CORE_NAME), uniqueKeyFieldName); // Unless the uniqueKeyField is marked 'required=false' then make sure it exists if( Boolean.FALSE != explicitRequiredProp.get( uniqueKeyFieldName ) ) { diff --git a/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java b/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java index 1a7bfe6af0a..2d16108d200 100644 --- a/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java +++ b/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java @@ -139,7 +139,7 @@ public class OpenExchangeRatesOrgProvider implements ExchangeRateProvider { public boolean reload() throws SolrException { InputStream ratesJsonStream = null; try { - log.info("Reloading exchange rates from "+ratesFileLocation); + log.debug("Reloading exchange rates from "+ratesFileLocation); try { ratesJsonStream = (new URL(ratesFileLocation)).openStream(); } catch (Exception e) { @@ -172,7 +172,7 @@ public class OpenExchangeRatesOrgProvider implements ExchangeRateProvider { refreshInterval = 60; log.warn("Specified refreshInterval was too small. Setting to 60 minutes which is the update rate of openexchangerates.org"); } - log.info("Initialized with rates="+ratesFileLocation+", refreshInterval="+refreshInterval+"."); + log.debug("Initialized with rates="+ratesFileLocation+", refreshInterval="+refreshInterval+"."); refreshIntervalSeconds = refreshInterval * 60; } catch (SolrException e1) { throw e1; diff --git a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java index cda315424eb..f5fe4641764 100644 --- a/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java +++ b/solr/core/src/java/org/apache/solr/servlet/SolrDispatchFilter.java @@ -117,6 +117,7 @@ public class SolrDispatchFilter extends BaseSolrFilter { @Override public void init(FilterConfig config) throws ServletException { + log.trace("SolrDispatchFilter.init(): {}", this.getClass().getClassLoader()); String muteConsole = System.getProperty(SOLR_LOG_MUTECONSOLE); if (muteConsole != null && !Arrays.asList("false","0","off","no").contains(muteConsole.toLowerCase(Locale.ROOT))) { StartupLoggingUtils.muteConsole(); @@ -142,7 +143,7 @@ public class SolrDispatchFilter extends BaseSolrFilter { this.cores = createCoreContainer(solrHome == null ? SolrResourceLoader.locateSolrHome() : Paths.get(solrHome), extraProperties); this.httpClient = cores.getUpdateShardHandler().getHttpClient(); - log.info("user.dir=" + System.getProperty("user.dir")); + log.debug("user.dir=" + System.getProperty("user.dir")); } catch( Throwable t ) { // catch this so our filter still works @@ -153,7 +154,7 @@ public class SolrDispatchFilter extends BaseSolrFilter { } } - log.info("SolrDispatchFilter.init() done"); + log.trace("SolrDispatchFilter.init() done"); } /** diff --git a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java index 30e31cac6b1..35096e53224 100644 --- a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java +++ b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java @@ -72,7 +72,7 @@ public class UpdateShardHandler { clientParams.set(HttpClientUtil.PROP_MAX_CONNECTIONS, cfg.getMaxUpdateConnections()); clientParams.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, cfg.getMaxUpdateConnectionsPerHost()); } - log.info("Created UpdateShardHandler HTTP client with params: {}", clientParams); + log.debug("Created UpdateShardHandler HTTP client with params: {}", clientParams); } public HttpClient getHttpClient() { diff --git a/solr/server/resources/log4j.properties b/solr/server/resources/log4j.properties index 672af4cb7a3..9d8eca0816a 100644 --- a/solr/server/resources/log4j.properties +++ b/solr/server/resources/log4j.properties @@ -19,6 +19,9 @@ log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (% log4j.logger.org.apache.zookeeper=WARN log4j.logger.org.apache.hadoop=WARN +log4j.logger.org.eclipse.jetty=WARN +log4j.logger.org.eclipse.jetty.server=INFO +log4j.logger.org.eclipse.jetty.server.handler=WARN # set to INFO to enable infostream log messages log4j.logger.org.apache.solr.update.LoggingInfoStream=OFF