Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pd/store): log files do not scroll with the process #2589

Merged
merged 6 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ if [ $(ps -ef|grep -v grep| grep java|grep -cE ${CONF}) -ne 0 ]; then
fi
echo "Starting HugeGraphPDServer..."

JVM_OPTIONS="-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager"
haohao0103 marked this conversation as resolved.
Show resolved Hide resolved

# 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="$!"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
<!-- Use mixed async way to output logs -->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments here are somewhat outdated. I found that AsyncLogger is still being used in hugegraph-pd/hg-pd-service/src/main/resources/log4j2.xml. Any context @imbajin?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments here are somewhat outdated. I found that AsyncLogger is still being used in hugegraph-pd/hg-pd-service/src/main/resources/log4j2.xml. Any context @imbajin?

maybe just due to (they) copy the config file from server?

<logger name="org.apache.hugegraph" level="INFO" additivity="false">
<appender-ref ref="file" />
<appender-ref ref="console" />
<!-- <appender-ref ref="console" />-->
haohao0103 marked this conversation as resolved.
Show resolved Hide resolved
</logger>
</loggers>
</configuration>
7 changes: 6 additions & 1 deletion hugegraph-pd/hg-pd-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@
<version>2.7</version>
<scope>compile</scope>
</dependency>

<!-- Bridge from JUL to Log4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>2.17.2</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
<!-- Use mixed async way to output logs -->
<logger name="org.apache.hugegraph" level="INFO" additivity="false">
<appender-ref ref="file"/>
<appender-ref ref="console"/>
<!-- <appender-ref ref="console"/>-->
</logger>
</loggers>
</configuration>
6 changes: 6 additions & 0 deletions hugegraph-store/hg-store-node/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@
<artifactId>log4j-api</artifactId>
<version>2.17.2</version>
</dependency>
<!-- Bridge from JUL to Log4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jul</artifactId>
<version>2.17.2</version>
</dependency>
<!-- module end -->
</dependencies>

Expand Down
Loading