You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by gc...@apache.org on 2016/04/29 23:17:42 UTC

lucene-solr:branch_6x: SOLR-9047: zkcli should allow alternative locations for log4j configuration

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 228aebe82 -> 67ebfb1cc


SOLR-9047: zkcli should allow alternative locations for log4j configuration


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/67ebfb1c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/67ebfb1c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/67ebfb1c

Branch: refs/heads/branch_6x
Commit: 67ebfb1cc257808e53f74d9c38a9729ded87a330
Parents: 228aebe
Author: Gregory Chanan <gc...@cloudera.com>
Authored: Fri Apr 29 11:29:24 2016 -0700
Committer: Gregory Chanan <gc...@cloudera.com>
Committed: Fri Apr 29 14:16:38 2016 -0700

----------------------------------------------------------------------
 solr/CHANGES.txt                            | 2 ++
 solr/server/scripts/cloud-scripts/zkcli.bat | 8 +++++++-
 solr/server/scripts/cloud-scripts/zkcli.sh  | 8 +++++++-
 3 files changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/67ebfb1c/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index ff19483..c870c51 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -180,6 +180,8 @@ Other Changes
 
 * SOLR-9037: Replace multiple "/replication" strings with one static constant. (Christine Poerschke)
 
+* SOLR-9047: zkcli should allow alternative locations for log4j configuration (Gregory Chanan)
+
 ==================  6.0.0 ==================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/67ebfb1c/solr/server/scripts/cloud-scripts/zkcli.bat
----------------------------------------------------------------------
diff --git a/solr/server/scripts/cloud-scripts/zkcli.bat b/solr/server/scripts/cloud-scripts/zkcli.bat
index 933e8a3..b4b9693 100644
--- a/solr/server/scripts/cloud-scripts/zkcli.bat
+++ b/solr/server/scripts/cloud-scripts/zkcli.bat
@@ -9,4 +9,10 @@ REM  Find location of this script
 set SDIR=%~dp0
 if "%SDIR:~-1%"=="\" set SDIR=%SDIR:~0,-1%
 
-"%JVM%" -Dlog4j.configuration="file:%SDIR%\log4j.properties" -classpath "%SDIR%\..\..\solr-webapp\webapp\WEB-INF\lib\*;%SDIR%\..\..\lib\ext\*" org.apache.solr.cloud.ZkCLI %*
+if defined LOG4J_PROPS (
+  set "LOG4J_CONFIG=file:%LOG4J_PROPS%"
+) else (
+  set "LOG4J_CONFIG=file:%SDIR%\log4j.properties"
+)
+
+"%JVM%" -Dlog4j.configuration="%LOG4J_PROPS%" -classpath "%SDIR%\..\..\solr-webapp\webapp\WEB-INF\lib\*;%SDIR%\..\..\lib\ext\*" org.apache.solr.cloud.ZkCLI %*

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/67ebfb1c/solr/server/scripts/cloud-scripts/zkcli.sh
----------------------------------------------------------------------
diff --git a/solr/server/scripts/cloud-scripts/zkcli.sh b/solr/server/scripts/cloud-scripts/zkcli.sh
index 15b5392..d049be0 100755
--- a/solr/server/scripts/cloud-scripts/zkcli.sh
+++ b/solr/server/scripts/cloud-scripts/zkcli.sh
@@ -9,5 +9,11 @@ JVM="java"
 
 sdir="`dirname \"$0\"`"
 
-PATH=$JAVA_HOME/bin:$PATH $JVM -Dlog4j.configuration=file:$sdir/log4j.properties -classpath "$sdir/../../solr-webapp/webapp/WEB-INF/lib/*:$sdir/../../lib/ext/*" org.apache.solr.cloud.ZkCLI ${1+"$@"}
+if [ -n "$LOG4J_PROPS" ]; then
+  log4j_config="file:$LOG4J_PROPS"
+else
+  log4j_config="file:$sdir/log4j.properties"
+fi
+
+PATH=$JAVA_HOME/bin:$PATH $JVM -Dlog4j.configuration=$log4j_config -classpath "$sdir/../../solr-webapp/webapp/WEB-INF/lib/*:$sdir/../../lib/ext/*" org.apache.solr.cloud.ZkCLI ${1+"$@"}