Apache Lucene open-source search software
SOLR-12008: Settle a location for the log4j2.xml file
Erick Erickson93ae3669b5b4
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex cfa27b84364..f0a65afbf5c 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -69,6 +69,10 @@ Upgrade Notes* SOLR-11694: Extremely outdated UIMA contrib module has been removed (Alexandre Rafalovitch)+* SOLR-12008: The configuration file for log4j2.xml is now in ../server/resources/log4j2.xml. All other copies have been removed.+ WINDOWS USERS: This JIRA corrects a bug in the start scripts that put example logs under ...\server, solr.log is+ now under ...\example. (Erick Erickson)+New Features----------------------@@ -124,7 +128,7 @@ Bug Fixes* SOLR-12413: If Zookeeper was pre-loaded with data before first-use, then the aliases information would be ignored.(David Smiley, Gaël Jourdan, Gus Heck)-+* SOLR-12482: Config API returns status 0 for failed operations. (Steve Rowe)* SOLR-12513: Reproducing TestCodecSupport.testMixedCompressionMode failure (Erick Erickson)diff --git a/solr/bin/solr b/solr/bin/solrindex 6612f2cd556..804ef2b3dc5 100755--- a/solr/bin/solr+++ b/solr/bin/solr@@ -698,7 +698,7 @@ function jetty_port() {function run_tool() {"$JAVA" $SOLR_SSL_OPTS $AUTHC_OPTS $SOLR_ZK_CREDS_AND_ACLS -Dsolr.install.dir="$SOLR_TIP" \- -Dlog4j.configurationFile="file:$DEFAULT_SERVER_DIR/scripts/cloud-scripts/log4j2.xml" \+ -Dlog4j.configurationFile="file:$DEFAULT_SERVER_DIR/resources/log4j2-console.xml" \-classpath "$DEFAULT_SERVER_DIR/solr-webapp/webapp/WEB-INF/lib/*:$DEFAULT_SERVER_DIR/lib/ext/*" \org.apache.solr.util.SolrCLI "$@"@@ -1845,7 +1845,7 @@ if [ -z "$SOLR_LOGS_DIR" ]; thenfiEXAMPLE_DIR="$SOLR_TIP/example"if [ "${SOLR_HOME:0:${#EXAMPLE_DIR}}" = "$EXAMPLE_DIR" ]; then- LOG4J_PROPS="$EXAMPLE_DIR/resources/log4j2.xml"+ LOG4J_PROPS="$DEFAULT_SERVER_DIR/resources/log4j2.xml"SOLR_LOGS_DIR="$SOLR_HOME/../logs"fi@@ -1995,7 +1995,7 @@ if [ -z "$SOLR_TIMEZONE" ]; thenfi# Launches Solr in foreground/background depending on parameters-function launch_solr() {+function start_solr() {run_in_foreground="$1"stop_port="$STOP_PORT"@@ -2165,6 +2165,6 @@ function launch_solr() {fi}-launch_solr "$FG" "$ADDITIONAL_CMD_OPTS" "$ADDITIONAL_JETTY_CONFIG"+start_solr "$FG" "$ADDITIONAL_CMD_OPTS" "$ADDITIONAL_JETTY_CONFIG"exit $?diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmdindex 274a1a8375c..1750c2f43a5 100755--- a/solr/bin/solr.cmd+++ b/solr/bin/solr.cmd@@ -979,14 +979,12 @@ IF [%SOLR_LOGS_DIR%] == [] () ELSE (set SOLR_LOGS_DIR=%SOLR_LOGS_DIR:"=%)-set SOLR_LOGS_DIR_QUOTED="%SOLR_LOGS_DIR%"-set SOLR_DATA_HOME_QUOTED="%SOLR_DATA_HOME%"set "EXAMPLE_DIR=%SOLR_TIP%\example"set TMP=!SOLR_HOME:%EXAMPLE_DIR%=!IF NOT "%TMP%"=="%SOLR_HOME%" (set "SOLR_LOGS_DIR=%SOLR_HOME%\..\logs"- set "LOG4J_CONFIG=file:%EXAMPLE_DIR%\resources\log4j2.xml"+ set "LOG4J_CONFIG=file:///%SOLR_SERVER_DIR%\resources\log4j2.xml")set IS_RESTART=0@@ -1260,9 +1258,13 @@ IF "%SOLR_SSL_ENABLED%"=="true" (set "START_OPTS=%START_OPTS% %SOLR_SSL_OPTS% !SSL_PORT_PROP!")IF NOT "%SOLR_LOG_LEVEL%"=="" set "START_OPTS=%START_OPTS% -Dsolr.log.level=%SOLR_LOG_LEVEL%"++set SOLR_LOGS_DIR_QUOTED="%SOLR_LOGS_DIR%"+set SOLR_DATA_HOME_QUOTED="%SOLR_DATA_HOME%"+set "START_OPTS=%START_OPTS% -Dsolr.log.dir=%SOLR_LOGS_DIR_QUOTED%"IF NOT "%SOLR_DATA_HOME%"=="" set "START_OPTS=%START_OPTS% -Dsolr.data.home=%SOLR_DATA_HOME_QUOTED%"-IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=file:%SOLR_SERVER_DIR%\resources\log4j2.xml"+IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=file:///%SOLR_SERVER_DIR%\resources\log4j2.xml"cd /d "%SOLR_SERVER_DIR%"@@ -1310,7 +1312,7 @@ IF "%FG%"=="1" (REM now wait to see Solr come online ..."%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%"^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI status -maxWaitSecs 30 -solr !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:%SOLR_PORT%/solr)@@ -1321,7 +1323,7 @@ goto doneREM Run the requested example"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI run_example -script "%SDIR%\solr.cmd" -e %EXAMPLE% -d "%SOLR_SERVER_DIR%" ^-urlScheme !SOLR_URL_SCHEME! !PASS_TO_RUN_EXAMPLE!@@ -1343,7 +1345,7 @@ for /f "usebackq" %%i in (`dir /b "%SOLR_TIP%\bin" ^| findstr /i "^solr-.*\.portset has_info=1echo Found Solr process %%k running on port !SOME_SOLR_PORT!"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI status -solr !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!SOME_SOLR_PORT!/solr@echo.@@ -1392,14 +1394,14 @@ IF NOT DEFINED HEALTHCHECK_VERBOSE set "HEALTHCHECK_VERBOSE="IF NOT DEFINED HEALTHCHECK_ZK_HOST set "HEALTHCHECK_ZK_HOST=localhost:9983"echo ZK_HOST: !ZK_HOST!"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI healthcheck -collection !HEALTHCHECK_COLLECTION! -zkHost !ZK_HOST! %HEALTHCHECK_VERBOSE%goto done:run_assert"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI %*if errorlevel 1 (@@ -1435,7 +1437,7 @@ IF NOT "!ZK_HOST!"=="" SET "CONFIG_ARGS=!CONFIG_ARGS! -z !ZK_HOST!"IF NOT "!SOLR_URL_SCHEME!"=="" SET "CONFIG_ARGS=!CONFIG_ARGS! -scheme !SOLR_URL_SCHEME!""%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI config !CONFIG_ARGS!if errorlevel 1 (@@ -1445,7 +1447,7 @@ goto done:get_version"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI versiongoto done@@ -1455,7 +1457,7 @@ set "TOOL_CMD=%~1"set q="-q"IF "%verbose%"=="1" set q="""%JAVA%" %SOLR_SSL_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI utils -s "%DEFAULT_SERVER_DIR%" -l "%SOLR_LOGS_DIR%" %q:"=% %TOOL_CMD%if errorlevel 1 (@@ -1561,13 +1563,13 @@ if "!CREATE_CONFDIR!"=="_default" (if "%SCRIPT_CMD%"=="create_core" ("%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI create_core -name !CREATE_NAME! -solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!CREATE_PORT!/solr ^-confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets" %CREATE_VERBOSE%) else ("%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%"^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI create -name !CREATE_NAME! -shards !CREATE_NUM_SHARDS! -replicationFactor !CREATE_REPFACT! ^-confname !CREATE_CONFNAME! -confdir !CREATE_CONFDIR! -configsetsDir "%SOLR_TIP%\server\solr\configsets" ^@@ -1642,7 +1644,7 @@ if "!DELETE_CONFIG!"=="" ()"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^--Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+-Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI delete -name !DELETE_NAME! -deleteConfig !DELETE_CONFIG! ^-solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!DELETE_PORT!/solr %DELETE_VERBOSE%@@ -1778,7 +1780,7 @@ IF "!ZK_OP!"=="upconfig" (goto zk_short_usage)"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI !ZK_OP! -confname !CONFIGSET_NAME! -confdir !CONFIGSET_DIR! -zkHost !ZK_HOST! %ZK_VERBOSE%^-configsetsDir "%SOLR_TIP%/server/solr/configsets"@@ -1792,7 +1794,7 @@ IF "!ZK_OP!"=="upconfig" (goto zk_short_usage)"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI !ZK_OP! -confname !CONFIGSET_NAME! -confdir !CONFIGSET_DIR! -zkHost !ZK_HOST! %ZK_VERBOSE%) ELSE IF "!ZK_OP!"=="cp" (@@ -1811,7 +1813,7 @@ IF "!ZK_OP!"=="upconfig" ())"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI !ZK_OP! -zkHost !ZK_HOST! -src !ZK_SRC! -dst !ZK_DST! -recurse !ZK_RECURSE! %ZK_VERBOSE%) ELSE IF "!ZK_OP!"=="mv" (@@ -1824,7 +1826,7 @@ IF "!ZK_OP!"=="upconfig" (goto zk_short_usage)"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI !ZK_OP! -zkHost !ZK_HOST! -src !ZK_SRC! -dst !ZK_DST! %ZK_VERBOSE%) ELSE IF "!ZK_OP!"=="rm" (@@ -1833,7 +1835,7 @@ IF "!ZK_OP!"=="upconfig" (goto zk_short_usage)"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI !ZK_OP! -zkHost !ZK_HOST! -path !ZK_SRC! -recurse !ZK_RECURSE! %ZK_VERBOSE%) ELSE IF "!ZK_OP!"=="ls" (@@ -1842,7 +1844,7 @@ IF "!ZK_OP!"=="upconfig" (goto zk_short_usage)"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI !ZK_OP! -zkHost !ZK_HOST! -path !ZK_SRC! -recurse !ZK_RECURSE! %ZK_VERBOSE%) ELSE IF "!ZK_OP!"=="mkroot" (@@ -1851,7 +1853,7 @@ IF "!ZK_OP!"=="upconfig" (goto zk_short_usage)"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%SOLR_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI !ZK_OP! -zkHost !ZK_HOST! -path !ZK_SRC! %ZK_VERBOSE%) ELSE (@@ -1912,7 +1914,7 @@ if "!AUTH_PORT!"=="" ())"%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% -Dsolr.install.dir="%SOLR_TIP%" ^- -Dlog4j.configurationFile="file:%DEFAULT_SERVER_DIR%\scripts\cloud-scripts\log4j2.xml" ^+ -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^-classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^org.apache.solr.util.SolrCLI auth %AUTH_PARAMS% -solrIncludeFile "%SOLR_INCLUDE%" -authConfDir "%SOLR_HOME%" ^-solrUrl !SOLR_URL_SCHEME!://%SOLR_TOOL_HOST%:!AUTH_PORT!/solrdiff --git a/solr/contrib/dataimporthandler/src/test-files/log4j2.xml b/solr/contrib/dataimporthandler/src/test-files/log4j2.xmldeleted file mode 100644index fd74d4ef83f..00000000000--- a/solr/contrib/dataimporthandler/src/test-files/log4j2.xml+++ /dev/null@@ -1,36 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<Configuration>- <Appenders>- <Console name="STDERR" target="SYSTEM_ERR">- <PatternLayout>- <Pattern>- %-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %c; %m%n- </Pattern>- </PatternLayout>- </Console>- </Appenders>- <Loggers>- <Logger name="org.apache.zookeeper" level="WARN"/>-- <Root level="INFO">- <AppenderRef ref="STDERR"/>- </Root>- </Loggers>-</Configuration>diff --git a/solr/contrib/ltr/src/test-files/log4j2.xml b/solr/contrib/ltr/src/test-files/log4j2.xmldeleted file mode 100644index b4678c171d7..00000000000--- a/solr/contrib/ltr/src/test-files/log4j2.xml+++ /dev/null@@ -1,40 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<Configuration>- <Appenders>- <Console name="STDERR" target="SYSTEM_ERR">- <PatternLayout>- <Pattern>- %-4r %-5p (%t) [%X{node_name} %X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n- </Pattern>- </PatternLayout>- </Console>- </Appenders>- <Loggers>- <Logger name="org.apache.zookeeper" level="WARN"/>- <Logger name="org.apache.hadoop" level="WARN"/>- <Logger name="org.apache.directory" level="WARN"/>- <Logger name="org.apache.solr.hadoop" level="INFO"/>- <Logger name="org.apache.solr.client.solrj.embedded.JettySolrRunner" level="DEBUG"/>-- <Root level="INFO">- <AppenderRef ref="STDERR"/>- </Root>- </Loggers>-</Configuration>diff --git a/solr/contrib/prometheus-exporter/bin/solr-exporter b/solr/contrib/prometheus-exporter/bin/solr-exporterindex 751e6c76f09..834e83ef1ec 100755--- a/solr/contrib/prometheus-exporter/bin/solr-exporter+++ b/solr/contrib/prometheus-exporter/bin/solr-exporter@@ -100,7 +100,7 @@ doCLASSPATH="$CLASSPATH":"$JAR"done-EXTRA_JVM_ARGUMENTS="-Xmx512m -Dlog4j.configurationFile=file:"$BASEDIR"/conf/log4j2.xml"+EXTRA_JVM_ARGUMENTS="-Xmx512m -Dlog4j.configurationFile=file:"$BASEDIR"/../../server/resources/log4j2-console.xml"# For Cygwin, switch paths to Windows format before running javaif $cygwin; thendiff --git a/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd b/solr/contrib/prometheus-exporter/bin/solr-exporter.cmdindex 31b88257763..f51cfa88289 100644--- a/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd+++ b/solr/contrib/prometheus-exporter/bin/solr-exporter.cmd@@ -69,7 +69,7 @@ if "%JAVACMD%"=="" set JAVACMD=javaif "%REPO%"=="" set REPO=%BASEDIR%\libset CLASSPATH=%REPO%\*;%BASEDIR%\..\..\dist\solrj-lib\*;%BASEDIR%\..\..\dist\*;%BASEDIR%\lucene-libs\*-set EXTRA_JVM_ARGUMENTS=-Xmx512m -Dlog4j.configurationFile=file:%BASEDIR%/conf/log4j2.xml+set EXTRA_JVM_ARGUMENTS=-Xmx512m -Dlog4j.configurationFile=file:///%BASEDIR%\..\..\server\resources\log4j2-console.xmlgoto endInit@REM Reaching here means variables are defined and arguments have been captureddiff --git a/solr/contrib/prometheus-exporter/conf/log4j2.xml b/solr/contrib/prometheus-exporter/conf/log4j2.xmldeleted file mode 100644index 218ee61730c..00000000000--- a/solr/contrib/prometheus-exporter/conf/log4j2.xml+++ /dev/null@@ -1,53 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<Configuration>- <Appenders>- <Console name="STDOUT" target="SYSTEM_OUT">- <PatternLayout>- <Pattern>- %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n- </Pattern>- </PatternLayout>- </Console>- <RollingFile- name="RollingFile"- fileName="${sys:solr.log.dir}/solr.log"- filePattern="${sys:solr.log.dir}/solr.log.%i" >- <PatternLayout>- <Pattern>- %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n- </Pattern>- </PatternLayout>- <Policies>- <SizeBasedTriggeringPolicy size="32 MB"/>- </Policies>- <DefaultRolloverStrategy max="10"/>- </RollingFile>- </Appenders>- <Loggers>- <Logger name="org.apache.hadoop" level="warn"/>- <Logger name="org.apache.solr.update.LoggingInfoStream" level="off"/>- <Logger name="org.apache.zookeeper" level="warn"/>-- <Root level="info">- <AppenderRef ref="RollingFile"/>- <AppenderRef ref="STDOUT"/>- </Root>- </Loggers>-</Configuration>diff --git a/solr/contrib/prometheus-exporter/src/test-files/conf/log4j2.xml b/solr/contrib/prometheus-exporter/src/test-files/conf/log4j2.xmldeleted file mode 100644index 5b31a73a415..00000000000--- a/solr/contrib/prometheus-exporter/src/test-files/conf/log4j2.xml+++ /dev/null@@ -1,35 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<Configuration>- <Appenders>- <Console name="STDERR" target="SYSTEM_ERR">- <PatternLayout>- <Pattern>- %d{yyyy-MM-dd'T'HH:mm:ss.SSS} %-5p [%c] - %m%n- </Pattern>- </PatternLayout>- </Console>- </Appenders>-- <Loggers>- <Root level="INFO">- <AppenderRef ref="STDERR"/>- </Root>- </Loggers>-</Configuration>diff --git a/solr/example/README.txt b/solr/example/README.txtindex 4e572e0144d..1bfb598905f 100644--- a/solr/example/README.txt+++ b/solr/example/README.txt@@ -73,6 +73,6 @@ solrconfig.xml.By default, Jetty & Solr will log to the console and logs/solr.log. This canbe convenient when first getting started, but eventually you will want tolog just to a file. To configure logging, edit the log4j2.xml file in-"resources".+".../server/resources".It is also possible to setup log4j or other popular logging frameworks.diff --git a/solr/example/resources/log4j2.xml b/solr/example/resources/log4j2.xmldeleted file mode 100644index 5868258cc44..00000000000--- a/solr/example/resources/log4j2.xml+++ /dev/null@@ -1,76 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<Configuration>- <Appenders>-- <Console name="STDOUT" target="SYSTEM_OUT">- <PatternLayout>- <Pattern>- %-4r [%t] %-5p %c %x [%X{collection} %X{shard} %X{replica} %X{core}] %c; %m%n- </Pattern>- </PatternLayout>- </Console>-- <RollingFile- name="RollingFile"- fileName="${sys:solr.log.dir}/solr.log"- filePattern="${sys:solr.log.dir}/solr.log.%i" >- <PatternLayout>- <Pattern>- %-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; [%X{collection} %X{shard} %X{replica} %X{core}] %c; %m%n- </Pattern>- </PatternLayout>- <Policies>- <OnStartupTriggeringPolicy />- <SizeBasedTriggeringPolicy size="32 MB"/>- </Policies>- <DefaultRolloverStrategy max="10"/>- </RollingFile>-- <RollingFile- name="SlowFile"- fileName="${sys:solr.log.dir}/solr_slow_requests.log"- filePattern="${sys:solr.log.dir}/solr_slow_requests.log.%i" >- <PatternLayout>- <Pattern>- %d{yyyy-MM-dd HH:mm:ss.SSS} %-5p (%t) [%X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n- </Pattern>- </PatternLayout>- <Policies>- <OnStartupTriggeringPolicy />- <SizeBasedTriggeringPolicy size="32 MB"/>- </Policies>- <DefaultRolloverStrategy max="10"/>- </RollingFile>-- </Appenders>- <Loggers>- <Logger name="org.apache.hadoop" level="warn"/>- <Logger name="org.apache.solr.update.LoggingInfoStream" level="off"/>- <Logger name="org.apache.zookeeper" level="warn"/>- <Logger name="org.apache.solr.core.SolrCore.SlowRequest" level="info" additivity="false">- <AppenderRef ref="SlowFile"/>- </Logger>-- <Root level="info">- <AppenderRef ref="RollingFile"/>- <AppenderRef ref="STDOUT"/>- </Root>- </Loggers>-</Configuration>diff --git a/solr/contrib/clustering/src/test-files/log4j2.xml b/solr/server/resources/log4j2-console.xmlsimilarity index 90%rename from solr/contrib/clustering/src/test-files/log4j2.xmlrename to solr/server/resources/log4j2-console.xmlindex 9b2a0291ff7..f32f4c142e2 100644--- a/solr/contrib/clustering/src/test-files/log4j2.xml+++ b/solr/server/resources/log4j2-console.xml@@ -16,6 +16,8 @@limitations under the License.-->+<!-- Use this file for logging exlusively to the console, useful for+ some development tasks. Should not be used for production --><Configuration><Appenders><Console name="STDERR" target="SYSTEM_ERR">diff --git a/solr/server/scripts/cloud-scripts/log4j2.xml b/solr/server/scripts/cloud-scripts/log4j2.xmldeleted file mode 100644index bd90f7747f2..00000000000--- a/solr/server/scripts/cloud-scripts/log4j2.xml+++ /dev/null@@ -1,37 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<Configuration>- <Appenders>- <Console name="STDERR" target="SYSTEM_ERR">- <PatternLayout>- <Pattern>- %-5p - %d{yyyy-MM-dd HH:mm:ss.SSS}; %c; %m%n- </Pattern>- </PatternLayout>- </Console>- </Appenders>- <Loggers>- <Logger name="org.apache.zookeeper" level="WARN"/>- <Logger name="org.apache.solr.common.cloud" level="WARN"/>-- <Root level="INFO">- <AppenderRef ref="STDERR"/>- </Root>- </Loggers>-</Configuration>diff --git a/solr/server/scripts/cloud-scripts/snapshotscli.sh b/solr/server/scripts/cloud-scripts/snapshotscli.shindex 59f6a94336c..e5a26d6457e 100755--- a/solr/server/scripts/cloud-scripts/snapshotscli.sh+++ b/solr/server/scripts/cloud-scripts/snapshotscli.sh@@ -8,7 +8,7 @@ run_solr_snapshot_tool() {if [ -n "$LOG4J_PROPS" ]; thenlog4j_config="file:${LOG4J_PROPS}"else- log4j_config="file:${scriptDir}/log4j2.xml"+ log4j_config="file:${scriptDir}/../../resources/log4j2-console.xml"fiPATH=${JAVA_HOME}/bin:${PATH} ${JVM} ${ZKCLI_JVM_FLAGS} -Dlog4j.configurationFile=${log4j_config} \-classpath "${solrLibPath}" org.apache.solr.core.snapshots.SolrSnapshotsTool "$@" 2> /dev/nulldiff --git a/solr/server/scripts/cloud-scripts/zkcli.bat b/solr/server/scripts/cloud-scripts/zkcli.batindex 7187b2024fa..67a1fd4933c 100644--- a/solr/server/scripts/cloud-scripts/zkcli.bat+++ b/solr/server/scripts/cloud-scripts/zkcli.bat@@ -10,9 +10,9 @@ set SDIR=%~dp0if "%SDIR:~-1%"=="\" set SDIR=%SDIR:~0,-1%if defined LOG4J_PROPS (- set "LOG4J_CONFIG=file:%LOG4J_PROPS%"+ set "LOG4J_CONFIG=file:///%LOG4J_PROPS%") else (- set "LOG4J_CONFIG=file:%SDIR%\log4j2.xml"+ set "LOG4J_CONFIG=file:///%SDIR%\..\..\resources\log4j2-console.xml")REM Settings for ZK ACLdiff --git a/solr/server/scripts/cloud-scripts/zkcli.sh b/solr/server/scripts/cloud-scripts/zkcli.shindex 97df2d4d49a..37b1ec9aa05 100755--- a/solr/server/scripts/cloud-scripts/zkcli.sh+++ b/solr/server/scripts/cloud-scripts/zkcli.sh@@ -12,7 +12,7 @@ sdir="`dirname \"$0\"`"if [ -n "$LOG4J_PROPS" ]; thenlog4j_config="file:$LOG4J_PROPS"else- log4j_config="file:$sdir/log4j2.xml"+ log4j_config="file:$sdir/../../resources/log4j2-console.xml"fi# Settings for ZK ACLdiff --git a/solr/solrj/src/test-files/log4j2.xml b/solr/solrj/src/test-files/log4j2.xmldeleted file mode 100644index 7d0ebf7a497..00000000000--- a/solr/solrj/src/test-files/log4j2.xml+++ /dev/null@@ -1,39 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<Configuration>- <Appenders>- <Console name="STDERR" target="SYSTEM_ERR">- <PatternLayout>- <Pattern>- %-4r %-5p (%t) [%X{node_name} %X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n- </Pattern>- </PatternLayout>- </Console>- </Appenders>- <Loggers>- <Logger name="org.apache.zookeeper" level="WARN"/>- <Logger name="org.apache.hadoop" level="WARN"/>- <Logger name="org.apache.directory" level="WARN"/>- <Logger name="org.apache.solr.hadoop" level="INFO"/>-- <Root level="INFO">- <AppenderRef ref="STDERR"/>- </Root>- </Loggers>-</Configuration>diff --git a/solr/test-framework/src/test-files/log4j2.xml b/solr/test-framework/src/test-files/log4j2.xmldeleted file mode 100644index 7d0ebf7a497..00000000000--- a/solr/test-framework/src/test-files/log4j2.xml+++ /dev/null@@ -1,39 +0,0 @@-<?xml version="1.0" encoding="UTF-8"?>-<!--- Licensed to the Apache Software Foundation (ASF) under one or more- contributor license agreements. See the NOTICE file distributed with- this work for additional information regarding copyright ownership.- The ASF licenses this file to You under the Apache License, Version 2.0- (the "License"); you may not use this file except in compliance with- the License. You may obtain a copy of the License at-- http://www.apache.org/licenses/LICENSE-2.0-- Unless required by applicable law or agreed to in writing, software- distributed under the License is distributed on an "AS IS" BASIS,- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.- See the License for the specific language governing permissions and- limitations under the License.- -->--<Configuration>- <Appenders>- <Console name="STDERR" target="SYSTEM_ERR">- <PatternLayout>- <Pattern>- %-4r %-5p (%t) [%X{node_name} %X{collection} %X{shard} %X{replica} %X{core}] %c{1.} %m%n- </Pattern>- </PatternLayout>- </Console>- </Appenders>- <Loggers>- <Logger name="org.apache.zookeeper" level="WARN"/>- <Logger name="org.apache.hadoop" level="WARN"/>- <Logger name="org.apache.directory" level="WARN"/>- <Logger name="org.apache.solr.hadoop" level="INFO"/>-- <Root level="INFO">- <AppenderRef ref="STDERR"/>- </Root>- </Loggers>-</Configuration>