From 24ebe9da266e570247d4d85e21c2e4b44e079d4b Mon Sep 17 00:00:00 2001 From: haohao0103 <956322745@qq.com> Date: Fri, 2 Aug 2024 17:58:12 +0800 Subject: [PATCH] fix(pd/store): log files do not scroll with the process (#2589) close #2581 GRPC Java defaults to using java. til.rogging (JUL) as its logging framework, --------- Co-authored-by: VGalaxies --- .../src/assembly/static/bin/start-hugegraph-pd.sh | 4 +++- hugegraph-pd/hg-pd-service/pom.xml | 7 ++++++- .../src/assembly/static/bin/start-hugegraph-store.sh | 2 +- hugegraph-store/hg-store-node/pom.xml | 6 ++++++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh b/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh index 722b864db7..151465ec6d 100644 --- a/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh +++ b/hugegraph-pd/hg-pd-dist/src/assembly/static/bin/start-hugegraph-pd.sh @@ -159,8 +159,10 @@ if [ $(ps -ef|grep -v grep| grep java|grep -cE ${CONF}) -ne 0 ]; then fi echo "Starting HugeGraphPDServer..." +JVM_OPTIONS="-Dlog4j.configurationFile=${CONF}/log4j2.xml -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager" + # Turn on security check -exec ${JAVA} -Dname="HugeGraphPD" ${JAVA_OPTIONS} -jar \ +exec ${JAVA} -Dname="HugeGraphPD" ${JVM_OPTIONS} ${JAVA_OPTIONS} -jar \ -Dspring.config.location=${CONF}/application.yml ${LIB}/hg-pd-service-*.jar >> ${OUTPUT} 2>&1 & PID="$!" diff --git a/hugegraph-pd/hg-pd-service/pom.xml b/hugegraph-pd/hg-pd-service/pom.xml index 682daba85d..14fed89ee0 100644 --- a/hugegraph-pd/hg-pd-service/pom.xml +++ b/hugegraph-pd/hg-pd-service/pom.xml @@ -139,7 +139,12 @@ 2.7 compile - + + + org.apache.logging.log4j + log4j-jul + 2.17.2 + diff --git a/hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh b/hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh index 991d42767a..b12fb354df 100644 --- a/hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh +++ b/hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh @@ -150,7 +150,7 @@ case "$GC_OPTION" in exit 1 esac -JVM_OPTIONS="-Dlog4j.configurationFile=${CONF}/log4j2.xml -Dfastjson.parser.safeMode=true" +JVM_OPTIONS="-Dlog4j.configurationFile=${CONF}/log4j2.xml -Dfastjson.parser.safeMode=true -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager" if [ "${OPEN_TELEMETRY}" == "true" ]; then OT_JAR="opentelemetry-javaagent.jar" diff --git a/hugegraph-store/hg-store-node/pom.xml b/hugegraph-store/hg-store-node/pom.xml index 90ba166ab8..cf0444584e 100644 --- a/hugegraph-store/hg-store-node/pom.xml +++ b/hugegraph-store/hg-store-node/pom.xml @@ -143,6 +143,12 @@ log4j-api 2.17.2 + + + org.apache.logging.log4j + log4j-jul + 2.17.2 +