mirror of https://github.com/apache/lucene.git
SOLR-9548: The beginning of solr.log now starts with a more informative welcome message
This commit is contained in:
parent
c809cd4f0a
commit
4c7a8c4b81
|
@ -193,6 +193,8 @@ Other Changes
|
||||||
* SOLR-9500: Add a LogLevel annotation to set log levels on specific tests (Alan
|
* SOLR-9500: Add a LogLevel annotation to set log levels on specific tests (Alan
|
||||||
Woodward)
|
Woodward)
|
||||||
|
|
||||||
|
* SOLR-9548: The beginning of solr.log now starts with a more informative welcome message (janhoy)
|
||||||
|
|
||||||
================== 6.2.1 ==================
|
================== 6.2.1 ==================
|
||||||
|
|
||||||
Bug Fixes
|
Bug Fixes
|
||||||
|
|
|
@ -1562,7 +1562,6 @@ function launch_solr() {
|
||||||
mkdir -p "$SOLR_LOGS_DIR"
|
mkdir -p "$SOLR_LOGS_DIR"
|
||||||
|
|
||||||
if [ "$run_in_foreground" == "true" ]; then
|
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[@]}"
|
exec "$JAVA" "${SOLR_START_OPTS[@]}" $SOLR_ADDL_ARGS -jar start.jar "${SOLR_JETTY_CONFIG[@]}"
|
||||||
else
|
else
|
||||||
# run Solr in the background
|
# run Solr in the background
|
||||||
|
|
|
@ -35,6 +35,7 @@ import java.io.OutputStream;
|
||||||
import java.lang.invoke.MethodHandles;
|
import java.lang.invoke.MethodHandles;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Locale;
|
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.io.output.CloseShieldOutputStream;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.http.client.HttpClient;
|
import org.apache.http.client.HttpClient;
|
||||||
|
import org.apache.lucene.util.Version;
|
||||||
import org.apache.solr.common.SolrException;
|
import org.apache.solr.common.SolrException;
|
||||||
import org.apache.solr.common.SolrException.ErrorCode;
|
import org.apache.solr.common.SolrException.ErrorCode;
|
||||||
import org.apache.solr.common.cloud.SolrZkClient;
|
import org.apache.solr.common.cloud.SolrZkClient;
|
||||||
|
@ -120,6 +122,8 @@ public class SolrDispatchFilter extends BaseSolrFilter {
|
||||||
public void init(FilterConfig config) throws ServletException
|
public void init(FilterConfig config) throws ServletException
|
||||||
{
|
{
|
||||||
log.trace("SolrDispatchFilter.init(): {}", this.getClass().getClassLoader());
|
log.trace("SolrDispatchFilter.init(): {}", this.getClass().getClassLoader());
|
||||||
|
|
||||||
|
logWelcomeBanner();
|
||||||
String muteConsole = System.getProperty(SOLR_LOG_MUTECONSOLE);
|
String muteConsole = System.getProperty(SOLR_LOG_MUTECONSOLE);
|
||||||
if (muteConsole != null && !Arrays.asList("false","0","off","no").contains(muteConsole.toLowerCase(Locale.ROOT))) {
|
if (muteConsole != null && !Arrays.asList("false","0","off","no").contains(muteConsole.toLowerCase(Locale.ROOT))) {
|
||||||
StartupLoggingUtils.muteConsole();
|
StartupLoggingUtils.muteConsole();
|
||||||
|
@ -162,6 +166,23 @@ public class SolrDispatchFilter extends BaseSolrFilter {
|
||||||
log.trace("SolrDispatchFilter.init() done");
|
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
|
* Override this to change CoreContainer initialization
|
||||||
* @return a CoreContainer to hold this server's cores
|
* @return a CoreContainer to hold this server's cores
|
||||||
|
|
Loading…
Reference in New Issue