Skip to content
Snippets Groups Projects
Commit daf42fce authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Explicitly specify log4j config file. (#1480)

parent b64af189
No related merge requests found
......@@ -10,7 +10,7 @@ rem Path to the java
rem INDEX_OPTIONS
rem Options to pass to the JVM
rem Make sure that environment edits are local and that we have access to the
rem Make sure that environment edits are local and that we have access to the
rem Windows command extensions.
setlocal enableextensions
if not errorlevel 1 goto extensionsokay
......@@ -61,7 +61,7 @@ rem ##################################################
rem # Set VUFIND_HOME
rem ##################################################
if not "!%VUFIND_HOME%!"=="!!" goto vufindhomefound
rem VUFIND_HOME not set -- try to call env.bat to
rem VUFIND_HOME not set -- try to call env.bat to
rem fix the problem before we give up completely
if exist env.bat goto useenvbat
rem If env.bat doesn't exist, the user hasn't run the installer yet.
......@@ -100,6 +100,17 @@ echo WARNING: VUFIND_LOCAL_DIR environment variable is not set. Is this intentio
set PROPERTIES_FILE=%VUFIND_HOME%\import\import.properties
:propertiesfound
rem ##################################################
rem # Set log4j config file if not already provided
rem ##################################################
if defined LOG4J_CONFIG goto log4jfound
if not exist %VUFIND_LOCAL_DIR%\import\log4j.properties goto nolocallog4j
set LOG4J_CONFIG=%VUFIND_LOCAL_DIR%\import\log4j.properties
goto log4jfound
:nolocallog4j
set LOG4J_CONFIG=%VUFIND_HOME%\import\log4j.properties
:log4jfound
rem ##################################################
rem # Set Command Options
rem ##################################################
......@@ -108,7 +119,7 @@ for %%a in (%VUFIND_HOME%\import\solrmarc_core_*.jar) do set JAR_FILE=%%a
rem #####################################################
rem # Execute Importer
rem #####################################################
set RUN_CMD=%JAVA% %INDEX_OPTIONS% -Duser.timezone=UTC %EXTRA_SOLRMARC_SETTINGS% -jar %JAR_FILE% %PROPERTIES_FILE% -solrj %VUFIND_HOME%\solr\vendor\dist\solrj-lib %1
set RUN_CMD=%JAVA% %INDEX_OPTIONS% -Duser.timezone=UTC -Dlog4j.configuration="file:///%LOG4J_CONFIG%" %EXTRA_SOLRMARC_SETTINGS% -jar %JAR_FILE% %PROPERTIES_FILE% -solrj %VUFIND_HOME%\solr\vendor\dist\solrj-lib %1
echo Now Importing %1 ...
echo %RUN_CMD%
%RUN_CMD%
......
......@@ -102,6 +102,19 @@ then
fi
fi
##################################################
# Set log4j config file if not already provided
##################################################
if [ -z "$LOG4J_CONFIG" ]
then
if [ -f "$VUFIND_LOCAL_DIR/import/log4j.properties" ]
then
LOG4J_CONFIG="$VUFIND_LOCAL_DIR/import/log4j.properties"
else
LOG4J_CONFIG="$VUFIND_HOME/import/log4j.properties"
fi
fi
##################################################
# Set Command Options
##################################################
......@@ -127,7 +140,7 @@ MARC_FILE=`basename $1`
# Execute Importer
#####################################################
RUN_CMD="$JAVA $INDEX_OPTIONS -Duser.timezone=UTC $EXTRA_SOLRMARC_SETTINGS -jar $JAR_FILE $PROPERTIES_FILE -solrj $VUFIND_HOME/solr/vendor/dist/solrj-lib $MARC_PATH/$MARC_FILE"
RUN_CMD="$JAVA $INDEX_OPTIONS -Duser.timezone=UTC -Dlog4j.configuration=file://$LOG4J_CONFIG $EXTRA_SOLRMARC_SETTINGS -jar $JAR_FILE $PROPERTIES_FILE -solrj $VUFIND_HOME/solr/vendor/dist/solrj-lib $MARC_PATH/$MARC_FILE"
echo "Now Importing $1 ..."
# solrmarc writes log messages to stderr, write RUN_CMD to the same place
echo "`date '+%h %d, %H:%M:%S'` $RUN_CMD" >&2
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment