SOLR-9548: The beginning of solr.log now starts with a more informative welcome message

This commit is contained in:
Jan Høydahl 2016-09-26 11:01:24 +02:00
parent c809cd4f0a
commit 4c7a8c4b81
3 changed files with 27 additions and 5 deletions

View File

@ -37,9 +37,9 @@ Upgrading from Solr 6.x
* HttpSolrClient#setDefaultMaxConnectionsPerHost and
HttpSolrClient#setMaxTotalConnections have been removed. These now default very
high and can only be changed via param when creating an HttpClient instance.
* Query time join with scoring {!join score=none} (even none) doesn't handle single value numeric fields.
Users are advised to convert these fields into string and reindex.
* Query time join with scoring {!join score=none} (even none) doesn't handle single value numeric fields.
Users are advised to convert these fields into string and reindex.
Bug Fixes
----------------------
@ -124,7 +124,7 @@ Bug Fixes
* SOLR-9542: Kerberos delegation tokens requires Jackson library (Ishan Chattopadhyaya via noble)
* SOLR-9330: Fix AlreadyClosedException on admin/mbeans?stats=true (Mikhail Khludnev)
* SOLR-9330: Fix AlreadyClosedException on admin/mbeans?stats=true (Mikhail Khludnev)
Optimizations
----------------------
@ -193,6 +193,8 @@ Other Changes
* SOLR-9500: Add a LogLevel annotation to set log levels on specific tests (Alan
Woodward)
* SOLR-9548: The beginning of solr.log now starts with a more informative welcome message (janhoy)
================== 6.2.1 ==================
Bug Fixes

View File

@ -1562,7 +1562,6 @@ function launch_solr() {
mkdir -p "$SOLR_LOGS_DIR"
if [ "$run_in_foreground" == "true" ]; then
echo -e "\nStarting Solr$IN_CLOUD_MODE on port $SOLR_PORT from $SOLR_SERVER_DIR\n"
exec "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -jar start.jar "${SOLR_JETTY_CONFIG[@]}"
else
# run Solr in the background

View File

@ -35,6 +35,7 @@ import java.io.OutputStream;
import java.lang.invoke.MethodHandles;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Locale;
@ -48,6 +49,7 @@ import org.apache.commons.io.input.CloseShieldInputStream;
import org.apache.commons.io.output.CloseShieldOutputStream;
import org.apache.commons.lang.StringUtils;
import org.apache.http.client.HttpClient;
import org.apache.lucene.util.Version;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.cloud.SolrZkClient;
@ -120,6 +122,8 @@ public class SolrDispatchFilter extends BaseSolrFilter {
public void init(FilterConfig config) throws ServletException
{
log.trace("SolrDispatchFilter.init(): {}", this.getClass().getClassLoader());
logWelcomeBanner();
String muteConsole = System.getProperty(SOLR_LOG_MUTECONSOLE);
if (muteConsole != null && !Arrays.asList("false","0","off","no").contains(muteConsole.toLowerCase(Locale.ROOT))) {
StartupLoggingUtils.muteConsole();
@ -162,6 +166,23 @@ public class SolrDispatchFilter extends BaseSolrFilter {
log.trace("SolrDispatchFilter.init() done");
}
private void logWelcomeBanner() {
log.info(" ___ _ Welcome to Apache Solr™ version {}", Version.LATEST);
log.info("/ __| ___| |_ _ Starting in {} mode on port {}", isCloudMode() ? "cloud" : "standalone", getSolrPort());
log.info("\\__ \\/ _ \\ | '_| Install dir: {}", System.getProperty("solr.install.dir"));
log.info("|___/\\___/_|_| Start time: {}", Instant.now().toString());
}
private String getSolrPort() {
return System.getProperty("jetty.port");
}
/* We are in cloud mode if Java option zkRun exists OR zkHost exists and is non-empty */
private boolean isCloudMode() {
return ((System.getProperty("zkHost") != null && !StringUtils.isEmpty(System.getProperty("zkHost")))
|| System.getProperty("zkRun") != null);
}
/**
* Override this to change CoreContainer initialization
* @return a CoreContainer to hold this server's cores