From 39feb76d2e322626525d111cb4b2753dae06c718 Mon Sep 17 00:00:00 2001 From: deajan Date: Thu, 14 Feb 2019 10:02:37 +0100 Subject: [PATCH] Simpler current log --- dev/ofunctions.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index c0383ef..b5959e3 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -31,7 +31,7 @@ #### OFUNCTIONS MINI SUBSET #### #### OFUNCTIONS MICRO SUBSET #### _OFUNCTIONS_VERSION=2.3.0-RC2 -_OFUNCTIONS_BUILD=2019012801 +_OFUNCTIONS_BUILD=2019021401 #### _OFUNCTIONS_BOOTSTRAP SUBSET #### _OFUNCTIONS_BOOTSTRAP=true #### _OFUNCTIONS_BOOTSTRAP SUBSET END #### @@ -192,8 +192,8 @@ function _Logger { echo -e "$logValue" >> "$LOG_FILE" # Build current log file for alerts if we have a sufficient environment - if [ "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP" != "" ]; then - echo -e "$logValue" >> "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP" + if [ "$RUN_DIR/$PROGRAM" != "/" ]; then + echo -e "$logValue" >> "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP.log" fi fi @@ -498,7 +498,7 @@ function SendAlert { attachment=true fi - body="$MAIL_ALERT_MSG"$'\n\n'"Last 1000 lines of log"$'\n\n'"$(tail -n 1000 $RUN_DIR/$PROGRAM._Logger.$SCRIPT_PID.$TSTAMP)" + body="$MAIL_ALERT_MSG"$'\n\n'"Last 1000 lines of current log"$'\n\n'"$(tail -n 1000 $RUN_DIR/$PROGRAM._Logger.$SCRIPT_PID.$TSTAMP.log)" if [ $ERROR_ALERT == true ]; then subject="Error alert for $INSTANCE_ID"