Mercurial > dive4elements > river
changeset 7732:772c22b0ea12
Merged
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Mon, 20 Jan 2014 14:54:35 +0100 |
parents | 91a57b66c7ed (current diff) e1c30527c104 (diff) |
children | 228be10e6165 |
files | |
diffstat | 3 files changed, 24 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore Mon Jan 20 12:44:16 2014 +0100 +++ b/.hgignore Mon Jan 20 14:54:35 2014 +0100 @@ -22,3 +22,4 @@ etl/test-output # eclipse junit/testng plugin output \.swp \.swo +\.jar
--- a/backend/contrib/import_river.sh Mon Jan 20 12:44:16 2014 +0100 +++ b/backend/contrib/import_river.sh Mon Jan 20 14:54:35 2014 +0100 @@ -70,7 +70,7 @@ -p, --port=<number> Use port number <number>. Default: $DEFAULT_PORT -d, --db-name=<database_name> Name of the database / backend. Default: $DEFAULT_BACKEND_NAME -l, --log-dir=<directory> Directory in which to create the log files. - Default: $LOG_DIR + Default: $PWD/logs --postgres Database is PostgreSQL --skip-hydro Skip import of hydrological data --skip-morpho Skip import of morphological data @@ -80,8 +80,8 @@ exit 0 } -OPTS=`getopt -o ?u:w:h:p:d: \ - -l help,username:,password:,host:,port:,db-name:,skip-hydro,skip-morpho,skip-geo,skip-prf,postgres \ +OPTS=`getopt -o ?u:w:h:p:d:l: \ + -l help,username:,password:,host:,port:,db-name:,log-dir:,skip-hydro,skip-morpho,skip-geo,skip-prf,postgres \ -n $0 -- "$@"` if [ $? != 0 ] ; then usage; fi eval set -- "$OPTS" @@ -146,7 +146,7 @@ if [ -z $BACKEND_NAME ]; then BACKEND_NAME=$DEFAULT_BACKEND_NAME fi -if [ -z $LOGDIR ]; then +if [ -z $LOG ]; then LOG=$DEFAULT_LOG fi @@ -164,6 +164,16 @@ LOG_DIR=${LOG}/`basename $GEW_FILE .gew`-$DATE mkdir -p ${LOG_DIR} +cat > "$LOG_DIR/log4j.properties" << "EOF" +log4j.rootLogger=DEBUG, IMPORTER +log4j.appender.IMPORTER.layout=org.apache.log4j.PatternLayout +log4j.appender.IMPORTER.layout.ConversionPattern=%d [%t] %-5p %c - %m%n +log4j.appender.IMPORTER=org.apache.log4j.RollingFileAppender +log4j.appender.IMPORTER.File=./import.log +log4j.appender.IMPORTER.MaxFileSize=100000KB +log4j.appender.IMPORTER.MaxBackupIndex=10 +EOF + if [ "$POSTGRES" = "TRUE" ]; then JAR=$(echo "$JAR" | sed 's/importer/importer_psql/') if [ ! -r "$JAR" ]; then @@ -189,7 +199,8 @@ LOG_FILE=${LOG_DIR}/hydro.log echo Importing Hydrological data. echo Logging into: $LOG_FILE - sed 's!./import.log!'"$LOG_FILE"'!' conf/log4j.properties > $LOG_DIR/log4j.properties + sed -i 's!\(log4j.appender.IMPORTER.File=\).*!\1'"$LOG_FILE"'!' \ + $LOG_DIR/log4j.properties java -jar \ -Xmx$MIN_MEMORY \ -server \ @@ -236,7 +247,8 @@ LOG_FILE=${LOG_DIR}/morpho.log echo Importing Morphological data. echo Logging into: $LOG_FILE - sed 's!./import.log!'"$LOG_FILE"'!' conf/log4j.properties > $LOG_DIR/log4j.properties + sed -i 's!\(log4j.appender.IMPORTER.File=\).*!\1'"$LOG_FILE"'!' \ + $LOG_DIR/log4j.properties java -jar \ -Xmx$MIN_MEMORY \ -server \ @@ -283,7 +295,8 @@ LOG_FILE=${LOG_DIR}/prf.log echo Importing cross section data. echo Logging into: $LOG_FILE - sed 's!./import.log!'"$LOG_FILE"'!' conf/log4j.properties > $LOG_DIR/log4j.properties + sed -i 's!\(log4j.appender.IMPORTER.File=\).*!\1'"$LOG_FILE"'!' \ + $LOG_DIR/log4j.properties java -jar \ -Xmx$MIN_MEMORY \ -server \
--- a/backend/doc/documentation/de/importer-hydr-morph.tex Mon Jan 20 12:44:16 2014 +0100 +++ b/backend/doc/documentation/de/importer-hydr-morph.tex Mon Jan 20 14:54:35 2014 +0100 @@ -908,3 +908,6 @@ \end{lstlisting} Alternativ können auch in diesem Skript einige Variablen (\textit{DEFAULT\_*}) angepasst werden. +Das Logging kann in diesem Fall nicht wie oben beschrieben +über \textit{conf/log4j.properties} angepasst werden, da hier +mehrere Log-Dateien geschrieben werden müssen.