Merge "Omaha #4694 Logback configurations will now append user.home to LOGDIR." into omaha_16.1.1
Former-commit-id: d129c358e3c525fa15b380b651df897e13a7fd4e
This commit is contained in:
commit
9facc2fc44
4 changed files with 20 additions and 14 deletions
|
@ -28,6 +28,7 @@
|
|||
# Oct 09, 2014 #3675 bclement added cleanExit signal trap
|
||||
# Jun 17, 2015 #4148 rferrel Logback needs fewer environment variables.
|
||||
# Jul 23, 2015 ASM#13849 D. Friedman Use a unique Eclipse configuration directory
|
||||
# Aug 03, 2015 #4694 dlovely Logback will now add user.home to LOGDIR
|
||||
#
|
||||
|
||||
user=`/usr/bin/whoami`
|
||||
|
@ -98,10 +99,12 @@ fi
|
|||
|
||||
#check for the logs directory, which may not be present at first start
|
||||
hostName=`hostname -s`
|
||||
export LOGDIR=$HOME/caveData/logs/consoleLogs/$hostName/
|
||||
# Logback configuration files will append user.home to LOGDIR.
|
||||
export LOGDIR=caveData/logs/consoleLogs/$hostName/
|
||||
FULL_LOGDIR=$HOME/$LOGDIR
|
||||
|
||||
if [ ! -d $LOGDIR ]; then
|
||||
mkdir -p $LOGDIR
|
||||
if [ ! -d $FULL_LOGDIR ]; then
|
||||
mkdir -p $FULL_LOGDIR
|
||||
fi
|
||||
|
||||
SWITCHES=()
|
||||
|
@ -156,7 +159,7 @@ do
|
|||
echo "Display is not available."
|
||||
exitVal=0
|
||||
else
|
||||
if [ -w ${LOGDIR} ] ; then
|
||||
if [ -w $FULL_LOGDIR ] ; then
|
||||
${dir}/alertviz "${SWITCHES[@]}" $* > /dev/null 2>&1 &
|
||||
else
|
||||
${dir}/alertviz "${SWITCHES[@]}" $* &
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
# Jan 28, 2015 #4018 randerso Added a productEditor log file to changes in the GFE product editor
|
||||
# Jun 17, 2015 #4148 rferrel Logback needs fewer environment variables.
|
||||
# Jul 23, 2015 ASM#13849 D. Friedman Use a unique Eclipse configuration directory
|
||||
# Aug 03, 2015 #4694 dlovely Logback will now add user.home to LOGDIR
|
||||
#
|
||||
|
||||
|
||||
|
@ -195,12 +196,14 @@ then
|
|||
PROGRAM_NAME="cave"
|
||||
fi
|
||||
|
||||
BASE_LOGDIR=$HOME/caveData/logs/consoleLogs
|
||||
BASE_LOGDIR=caveData/logs/consoleLogs
|
||||
# Logback configuration files will append user.home to LOGDIR.
|
||||
export LOGDIR=$BASE_LOGDIR/$hostName/
|
||||
FULL_LOGDIR=$HOME/$LOGDIR
|
||||
|
||||
# make sure directory exists
|
||||
if [ ! -d $LOGDIR ]; then
|
||||
mkdir -p $LOGDIR
|
||||
if [ ! -d $FULL_LOGDIR ]; then
|
||||
mkdir -p $FULL_LOGDIR
|
||||
fi
|
||||
|
||||
# delete any old disk caches in the background
|
||||
|
@ -209,7 +212,7 @@ deleteOldCaveLogs &
|
|||
curTime=`date +%Y%m%d_%H%M%S`
|
||||
|
||||
pid=$!
|
||||
export LOGFILE_STARTUP_SHUTDOWN="${LOGDIR}/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
|
||||
export LOGFILE_STARTUP_SHUTDOWN="$FULL_LOGDIR/${PROGRAM_NAME}_${pid}_${curTime}_pid_%PID%_startup-shutdown.log"
|
||||
|
||||
createEclipseConfigurationDir
|
||||
|
||||
|
@ -217,7 +220,7 @@ createEclipseConfigurationDir
|
|||
# this process can log the exit status of cave.
|
||||
(
|
||||
# can we write to log directory
|
||||
if [ -w ${LOGDIR} ]; then
|
||||
if [ -w $FULL_LOGDIR ]; then
|
||||
touch ${LOGFILE_STARTUP_SHUTDOWN}
|
||||
fi
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
# Jul 11, 2014 #3371 bclement added killSpawn()
|
||||
# Oct 13, 2014 #3675 bclement logExitStatus() waits for child to start and renames log with child PID
|
||||
# Jul 23, 2015 ASM#13849 D. Friedman Use a unique Eclipse configuration directory
|
||||
|
||||
# Aug 03, 2015 #4694 dlovely Fixed path for log file cleanup
|
||||
|
||||
source /awips2/cave/iniLookup.sh
|
||||
RC=$?
|
||||
|
@ -383,10 +383,10 @@ function deleteOldCaveLogs()
|
|||
local mybox=$(hostname)
|
||||
|
||||
echo -e "Cleaning consoleLogs: "
|
||||
echo -e "find $BASE_LOGDIR -type f -name "*.log" -mtime +7 -exec rm {} \;"
|
||||
echo -e "find $HOME/$BASE_LOGDIR -type f -name "*.log" -mtime +7 -exec rm {} \;"
|
||||
|
||||
|
||||
find "$BASE_LOGDIR" -type f -name "*.log" -mtime +7 -exec rm {} \;
|
||||
find "$HOME/$BASE_LOGDIR" -type f -name "*.log" -mtime +7 -exec rm {} \;
|
||||
|
||||
exit 0
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
-->
|
||||
<timestamp key="startTime" datePattern="yyyyMMdd_HHmmss" />
|
||||
<define name="adminLogFile" class="com.raytheon.uf.common.logback.LogFilePropertyDefiner" >
|
||||
<directory>${LOGDIR}</directory>
|
||||
<directory>${user.home}/${LOGDIR}</directory>
|
||||
<name>alertviz_${startTime}_admin.log</name>
|
||||
</define>
|
||||
<define name="consoleLogFile" class="com.raytheon.uf.common.logback.LogFilePropertyDefiner" >
|
||||
<directory>${LOGDIR}</directory>
|
||||
<directory>${user.home}/${LOGDIR}</directory>
|
||||
<name>alertviz_${startTime}_console.log</name>
|
||||
</define>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue