From 43bfb808e1f82a428521579db3daee59ba966871 Mon Sep 17 00:00:00 2001 From: qifanwang Date: Wed, 15 May 2024 15:07:41 +0800 Subject: [PATCH] add config for arthas-logback --- .../src/main/config/arthas-logback.xml | 35 +++++++++++++++++++ .../src/main/config/redis-console.conf | 2 +- .../src/main/scripts/startup.sh | 3 ++ .../src/main/config/arthas-logback.xml | 35 +++++++++++++++++++ .../src/main/config/redis-keeper.conf | 2 +- .../src/main/scripts/startup.sh | 1 + 6 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 redis/package/redis-console-package/src/main/config/arthas-logback.xml create mode 100644 redis/package/redis-keeper-package/src/main/config/arthas-logback.xml diff --git a/redis/package/redis-console-package/src/main/config/arthas-logback.xml b/redis/package/redis-console-package/src/main/config/arthas-logback.xml new file mode 100644 index 000000000..402628dfc --- /dev/null +++ b/redis/package/redis-console-package/src/main/config/arthas-logback.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + [%d{HH:mm:ss:SSS}][%p][%t][%X{class}]%message%xEx%n + + + + + ${baseDir}/${appName}-proxy-client.log + + + + ${baseDir}/${appName}-proxy-client-%d{yyyy-MM-dd}-%i.log.gz + 30 + 10GB + 100MB + + + + [%d{HH:mm:ss:SSS}][%p][%t][%c]%message%xEx%n + + + + + + + + \ No newline at end of file diff --git a/redis/package/redis-console-package/src/main/config/redis-console.conf b/redis/package/redis-console-package/src/main/config/redis-console.conf index 33c5fc0c5..7fdd449d0 100644 --- a/redis/package/redis-console-package/src/main/config/redis-console.conf +++ b/redis/package/redis-console-package/src/main/config/redis-console.conf @@ -1,4 +1,4 @@ MODE=service PID_FOLDER=. -JAVA_OPTS="$JAVA_OPTS -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlogging.config=config/log4j2.xml -Dlog4j.configurationFile=config/log4j2.xml -Dlocalpath=config -DFXXPIPE_HOME=config" +JAVA_OPTS="$JAVA_OPTS -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlogging.config=config/log4j2.xml -Dlog4j.configurationFile=config/log4j2.xml -Darthas.logback.configurationFile=config/arthas-logback.xml -Dlocalpath=config -DFXXPIPE_HOME=config" LOG_FOLDER=/opt/logs/100004374/ \ No newline at end of file diff --git a/redis/package/redis-console-package/src/main/scripts/startup.sh b/redis/package/redis-console-package/src/main/scripts/startup.sh index 1ec4ab34c..acca1e661 100644 --- a/redis/package/redis-console-package/src/main/scripts/startup.sh +++ b/redis/package/redis-console-package/src/main/scripts/startup.sh @@ -60,7 +60,10 @@ function changeAndMakeLogDir(){ makedir $logdir #../xx.conf sed -i 's#LOG_FOLDER=\(.*\)#LOG_FOLDER='"$logdir"'#' $current/../*.conf + + // sed -i 's#name="baseDir">.*#name="baseDir">'$logdir'#' $current/../config/log4j2.xml + sed -i 's|||' $current/../config/arthas-logback.xml } function changePort(){ conf=$1 diff --git a/redis/package/redis-keeper-package/src/main/config/arthas-logback.xml b/redis/package/redis-keeper-package/src/main/config/arthas-logback.xml new file mode 100644 index 000000000..9c5ee832b --- /dev/null +++ b/redis/package/redis-keeper-package/src/main/config/arthas-logback.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + [%d{HH:mm:ss:SSS}][%p][%t][%X{class}]%message%xEx%n + + + + + ${baseDir}/${appName}-proxy-client.log + + + + ${baseDir}/${appName}-proxy-client-%d{yyyy-MM-dd}-%i.log.gz + 30 + 10GB + 100MB + + + + [%d{HH:mm:ss:SSS}][%p][%t][%c]%message%xEx%n + + + + + + + + \ No newline at end of file diff --git a/redis/package/redis-keeper-package/src/main/config/redis-keeper.conf b/redis/package/redis-keeper-package/src/main/config/redis-keeper.conf index 62772bec1..d7fc35d96 100644 --- a/redis/package/redis-keeper-package/src/main/config/redis-keeper.conf +++ b/redis/package/redis-keeper-package/src/main/config/redis-keeper.conf @@ -1,4 +1,4 @@ MODE=service PID_FOLDER=. -JAVA_OPTS="$JAVA_OPTS -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlogging.config=config/log4j2.xml -Dlog4j.configurationFile=config/log4j2.xml -Dlocalpath=config" +JAVA_OPTS="$JAVA_OPTS -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector -Dlogging.config=config/log4j2.xml -Dlog4j.configurationFile=config/log4j2.xml -Darthas.logback.configurationFile=config/arthas-logback.xml -Dlocalpath=config" LOG_FOLDER=/opt/logs/100004376/ \ No newline at end of file diff --git a/redis/package/redis-keeper-package/src/main/scripts/startup.sh b/redis/package/redis-keeper-package/src/main/scripts/startup.sh index 44ce2d01b..892443474 100644 --- a/redis/package/redis-keeper-package/src/main/scripts/startup.sh +++ b/redis/package/redis-keeper-package/src/main/scripts/startup.sh @@ -72,6 +72,7 @@ function changeAndMakeLogDir(){ #../xx.conf sed -i 's#LOG_FOLDER=\(.*\)#LOG_FOLDER='"$logdir"'#' $current/../*.conf sed -i 's#name="baseDir">.*#name="baseDir">'$logdir'#' $current/../config/log4j2.xml + sed -i 's|||' $current/../config/arthas-logback.xml } function changeConfigLogFile() { current=$1