From 59f840ba6aa56856100d16ddaf56f55e99c1497d Mon Sep 17 00:00:00 2001 From: himanshumaurya09876 Date: Wed, 24 Jan 2024 13:24:40 +0530 Subject: [PATCH] RANGER-4672: updated tagsync log configuration to include hostname and username in log file name Signed-off-by: Madhan Neethiraj --- tagsync/conf.dist/logback.xml | 4 ++-- tagsync/scripts/ranger-tagsync-services.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tagsync/conf.dist/logback.xml b/tagsync/conf.dist/logback.xml index c1a94fee41..71cc4a5e0f 100644 --- a/tagsync/conf.dist/logback.xml +++ b/tagsync/conf.dist/logback.xml @@ -21,12 +21,12 @@ - ${logdir}/tagsync.log + ${logdir}/tagsync-${hostname}-${user}.log %d{dd MMM yyyy HH:mm:ss} %5p %c{1} [%t] - %L %m%n - ${logdir}/tagsync.log.%d{yyyy-MM-dd} + ${logdir}/tagsync-${hostname}-${user}.log.%d{yyyy-MM-dd} 15 true diff --git a/tagsync/scripts/ranger-tagsync-services.sh b/tagsync/scripts/ranger-tagsync-services.sh index 460c4a130f..ab23ab9b2d 100755 --- a/tagsync/scripts/ranger-tagsync-services.sh +++ b/tagsync/scripts/ranger-tagsync-services.sh @@ -97,7 +97,7 @@ if [ "${action}" == "START" ]; then fi SLEEP_TIME_AFTER_START=5 - nohup java -Dproc_rangertagsync ${JAVA_OPTS} -Dlogdir="${RANGER_TAGSYNC_LOG_DIR}" -Dlogback.configurationFile=file:${TAGSYNC_CONF_DIR}/logback.xml -cp "${cp}" org.apache.ranger.tagsync.process.TagSynchronizer > ${RANGER_TAGSYNC_LOG_DIR}/tagsync.out 2>&1 & + nohup java -Dproc_rangertagsync ${JAVA_OPTS} -Dlogdir="${RANGER_TAGSYNC_LOG_DIR}" -Dlogback.configurationFile=file:${TAGSYNC_CONF_DIR}/logback.xml -Duser=${USER} -Dhostname=${HOSTNAME} -cp "${cp}" org.apache.ranger.tagsync.process.TagSynchronizer > ${RANGER_TAGSYNC_LOG_DIR}/tagsync.out 2>&1 & VALUE_OF_PID=$! echo "Starting Apache Ranger Tagsync Service" sleep $SLEEP_TIME_AFTER_START