You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by et...@apache.org on 2023/03/09 04:30:46 UTC

[incubator-celeborn] branch main updated: [CELEBORN-385] Add rolling file in log4j configuration template (#1317)

This is an automated email from the ASF dual-hosted git repository.

ethanfeng pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-celeborn.git


The following commit(s) were added to refs/heads/main by this push:
     new 393fabc0c [CELEBORN-385] Add rolling file in log4j configuration template (#1317)
393fabc0c is described below

commit 393fabc0c3f5674230d893a9d6aeae5da4a67339
Author: Ethan Feng <et...@apache.org>
AuthorDate: Thu Mar 9 12:30:40 2023 +0800

    [CELEBORN-385] Add rolling file in log4j configuration template (#1317)
---
 conf/log4j2.xml.template | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/conf/log4j2.xml.template b/conf/log4j2.xml.template
index 24173a2b5..b2fdf4ef0 100644
--- a/conf/log4j2.xml.template
+++ b/conf/log4j2.xml.template
@@ -32,14 +32,26 @@
               -->
             <PatternLayout pattern="%d{yy/MM/dd HH:mm:ss,SSS} %p [%t] %c{1}: %m%n%ex"/>
         </Console>
+        <RollingRandomAccessFile name="file" fileName="${env:CELEBORN_LOG_DIR}/celeborn.log" filePattern="${env:CELEBORN_LOG_DIR}/celeborn.log.%d">
+            <PatternLayout pattern="%d{yy/MM/dd HH:mm:ss,SSS} %p [%t] %c{1}: %m%n%ex"/>
+            <Policies>
+                <SizeBasedTriggeringPolicy size="200 MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="7"/>
+        </RollingRandomAccessFile>
     </Appenders>
 
     <Loggers>
         <Root level="INFO">
+            <!--
+              ~ Here are appender templates, keep the appender as your need.
+              -->
             <AppenderRef ref="stdout"/>
+            <AppenderRef ref="file"/>
         </Root>
         <Logger name="org.apache.hadoop.hdfs" level="WARN" additivity="false">
             <Appender-ref ref="stdout" level="WARN" />
+            <Appender-ref ref="file" level="WARN"/>
         </Logger>
     </Loggers>
 </Configuration>