SOLR-9885: Allow pre-startup Solr log management in Solr bin scripts to be disabled.

This commit is contained in:
markrmiller 2017-01-19 03:07:09 -05:00
parent bb35732eef
commit 075aec91cd
5 changed files with 27 additions and 9 deletions

View File

@ -102,6 +102,8 @@ New Features
* SOLR-9926: Allow passing arbitrary java system properties to zkcli. (Hrishikesh Gadre via Mark Miller)
* SOLR-9885: Allow pre-startup Solr log management in Solr bin scripts to be disabled. (Mano Kovacs via Mark Miller)
Bug Fixes
----------------------

View File

@ -1480,11 +1480,12 @@ if [ ! -e "$SOLR_HOME" ]; then
echo -e "\nSolr home directory $SOLR_HOME not found!\n"
exit 1
fi
run_tool utils -s "$DEFAULT_SERVER_DIR" -l "$SOLR_LOGS_DIR" -remove_old_solr_logs 7 || echo "Failed removing old solr logs"
run_tool utils -s "$DEFAULT_SERVER_DIR" -l "$SOLR_LOGS_DIR" -archive_gc_logs || echo "Failed archiving old GC logs"
run_tool utils -s "$DEFAULT_SERVER_DIR" -l "$SOLR_LOGS_DIR" -archive_console_logs || echo "Failed archiving old console logs"
run_tool utils -s "$DEFAULT_SERVER_DIR" -l "$SOLR_LOGS_DIR" -rotate_solr_logs 9 || echo "Failed rotating old solr logs"
if [ "${SOLR_LOG_PRESTART_ROTATION:=true}" == "true" ]; then
run_tool utils -s "$DEFAULT_SERVER_DIR" -l "$SOLR_LOGS_DIR" -remove_old_solr_logs 7 || echo "Failed removing old solr logs"
run_tool utils -s "$DEFAULT_SERVER_DIR" -l "$SOLR_LOGS_DIR" -archive_gc_logs || echo "Failed archiving old GC logs"
run_tool utils -s "$DEFAULT_SERVER_DIR" -l "$SOLR_LOGS_DIR" -archive_console_logs || echo "Failed archiving old console logs"
run_tool utils -s "$DEFAULT_SERVER_DIR" -l "$SOLR_LOGS_DIR" -rotate_solr_logs 9 || echo "Failed rotating old solr logs"
fi
java_ver_out=`echo "$("$JAVA" -version 2>&1)"`
JAVA_VERSION=`echo $java_ver_out | grep "java version" | awk '{ print substr($3, 2, length($3)-2); }'`

View File

@ -939,10 +939,15 @@ IF ERRORLEVEL 1 (
)
REM Clean up and rotate logs
call :run_utils "-remove_old_solr_logs 7" || echo "Failed removing old solr logs"
call :run_utils "-archive_gc_logs" || echo "Failed archiving old GC logs"
call :run_utils "-archive_console_logs" || echo "Failed archiving old console logs"
call :run_utils "-rotate_solr_logs 9" || echo "Failed rotating old solr logs"
IF [%SOLR_LOG_PRESTART_ROTATION%] == [] (
set SOLR_LOG_PRESTART_ROTATION=true
)
IF [%SOLR_LOG_PRESTART_ROTATION%] == [true] (
call :run_utils "-remove_old_solr_logs 7" || echo "Failed removing old solr logs"
call :run_utils "-archive_gc_logs" || echo "Failed archiving old GC logs"
call :run_utils "-archive_console_logs" || echo "Failed archiving old console logs"
call :run_utils "-rotate_solr_logs 9" || echo "Failed rotating old solr logs"
)
IF NOT "%ZK_HOST%"=="" set SOLR_MODE=solrcloud

View File

@ -75,6 +75,11 @@ REM set SOLR_LOG_LEVEL=INFO
REM Location where Solr should write logs to. Absolute or relative to solr start dir
REM set SOLR_LOGS_DIR=logs
REM Enables log rotation, cleanup, and archiving before starting Solr. Setting SOLR_LOG_PRESTART_ROTATION=false will skip start
REM time rotation of logs, and the archiving of the last GC and console log files. It does not affect Log4j configuration. This
REM pre-startup rotation may need to be disabled depending how much you customize the default logging setup.
REM set SOLR_LOG_PRESTART_ROTATION=true
REM Set the host interface to listen on. Jetty will listen on all interfaces (0.0.0.0) by default.
REM This must be an IPv4 ("a.b.c.d") or bracketed IPv6 ("[x::y]") address, not a hostname!
REM set SOLR_JETTY_HOST=0.0.0.0

View File

@ -91,6 +91,11 @@
# Location where Solr should write logs to. Absolute or relative to solr start dir
#SOLR_LOGS_DIR=logs
# Enables log rotation, cleanup, and archiving during start. Setting SOLR_LOG_PRESTART_ROTATION=false will skip start
# time rotation of logs, and the archiving of the last GC and console log files. It does not affect Log4j configuration.
# This pre-startup rotation may need to be disabled depending how much you customize the default logging setup.
#SOLR_LOG_PRESTART_ROTATION=true
# Sets the port Solr binds to, default is 8983
#SOLR_PORT=8983