Skip to content

Commit

Permalink
feat: Specify log4j2 configuration file using Java option log4j2.conf… (
Browse files Browse the repository at this point in the history
#588)

Signed-off-by: Li Zhanhui <[email protected]>
  • Loading branch information
lizhanhui authored Nov 7, 2023
1 parent 121e70c commit d7eb6b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion broker/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
<Logger name="com.automq.rocketmq.metadata.mapper" level="trace" additivity="false">
<AppenderRef ref="mybatisAppender" />
</Logger>

<Logger name="com.zaxxer.hikari" level="debug" additivity="false">
<AppenderRef ref="mybatisAppender" />
</Logger>
Expand Down
4 changes: 3 additions & 1 deletion distribution/bin/run-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,7 @@ JAVA_OPT="${JAVA_OPT} -Xdebug -Xrunjdwp:transport=dt_socket,address=9555,server=
JAVA_OPT="${JAVA_OPT} -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${GC_LOG_DIR}/oomheapdump.hprof"
JAVA_OPT="${JAVA_OPT} ${JAVA_OPT_EXT}"
JAVA_OPT="${JAVA_OPT} -cp ${CLASSPATH}"
# https://logging.apache.org/log4j/2.x/manual/configuration.html#automatic-configuration
JAVA_OPT="${JAVA_OPT} -Dlog4j.configurationFile=file:${BASE_DIR}/conf/log4j2.xml"

"$JAVA" ${JAVA_OPT} $@
"$JAVA" "${JAVA_OPT}" "$@"
2 changes: 1 addition & 1 deletion distribution/conf/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<Logger name="com.automq.stream" level="info" additivity="false">
<AppenderRef ref="streamAppender"/>
</Logger>
<Logger name="com.automq.rocketmq.metadata.mapper" level="trace" additivity="false">
<Logger name="com.automq.rocketmq.metadata.mapper" level="debug" additivity="false">
<AppenderRef ref="mybatisAppender" />
</Logger>
<Root level="info">
Expand Down

0 comments on commit d7eb6b7

Please sign in to comment.