You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by pe...@apache.org on 2022/05/31 03:16:21 UTC

[incubator-linkis] branch dev-1.1.3 updated: EC logs need to support rolling (#2159)

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

peacewong pushed a commit to branch dev-1.1.3
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.1.3 by this push:
     new c3ee2add8 EC logs need to support rolling (#2159)
c3ee2add8 is described below

commit c3ee2add84552000ad7609e3b8866876f347ee06
Author: Alexyang <xu...@qq.com>
AuthorDate: Tue May 31 11:16:16 2022 +0800

    EC logs need to support rolling (#2159)
    
    * 1. add rolling-file log support for engine plugins
    
    * 1. engineplugins - log4j.xml change log file to 'stdout'
    
    * engineplugins - fix log4j2.xml
---
 .../flink/src/main/resources/log4j2.xml                   | 15 ++++++++++-----
 .../engineconn-plugins/hive/src/main/resources/log4j2.xml | 15 ++++++++++-----
 .../io_file/src/main/resources/log4j2.xml                 | 15 ++++++++++-----
 .../engineconn-plugins/jdbc/src/main/resources/log4j2.xml | 15 ++++++++++-----
 .../pipeline/src/main/resources/log4j2.xml                | 15 ++++++++++-----
 .../python/src/main/resources/log4j2.xml                  | 15 ++++++++++-----
 .../shell/src/main/resources/conf/log4j2.xml              | 15 ++++++++++-----
 .../spark/src/main/resources/log4j2.xml                   | 15 ++++++++++-----
 8 files changed, 80 insertions(+), 40 deletions(-)

diff --git a/linkis-engineconn-plugins/engineconn-plugins/flink/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/engineconn-plugins/flink/src/main/resources/log4j2.xml
index cdc6ed547..3f402136e 100644
--- a/linkis-engineconn-plugins/engineconn-plugins/flink/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/engineconn-plugins/flink/src/main/resources/log4j2.xml
@@ -18,10 +18,15 @@
   
 <configuration status="error" monitorInterval="30">
     <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
-            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M - %msg%xEx%n"/>
-        </Console>
+        <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
+                     filePattern="${env:LOG_DIRS}/$${date:yyyy-MM}/linkis-log-%d{yyyy-MM-dd-hh}-%i.log">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
 
         <Send name="Send" >
             <Filters>
@@ -39,8 +44,8 @@
     <loggers>
         <root level="INFO">
             <appender-ref ref="stderr"/>
-            <appender-ref ref="Console"/>
             <appender-ref ref="Send"/>
+            <appender-ref ref="RollingFile"/>
         </root>
         <logger name="org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter" level="error" additivity="true">
             <appender-ref ref="stderr"/>
diff --git a/linkis-engineconn-plugins/engineconn-plugins/hive/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/engineconn-plugins/hive/src/main/resources/log4j2.xml
index 020b94567..c5c06cc52 100644
--- a/linkis-engineconn-plugins/engineconn-plugins/hive/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/engineconn-plugins/hive/src/main/resources/log4j2.xml
@@ -18,10 +18,15 @@
   
 <configuration status="error" monitorInterval="30">
     <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
-            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M - %msg%xEx%n"/>
-        </Console>
+        <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
+                     filePattern="${env:LOG_DIRS}/$${date:yyyy-MM}/linkis-log-%d{yyyy-MM-dd-hh}-%i.log">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
 
         <Send name="Send" >
             <Filters>
@@ -43,7 +48,7 @@
     <loggers>
       <root level="INFO">
             <appender-ref ref="stderr"/>
-            <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFile"/>
             <appender-ref ref="Send"/>
         </root>
         <logger name="org.apache.hadoop.hive.ql.exec.StatsTask" level="info" additivity="true">
diff --git a/linkis-engineconn-plugins/engineconn-plugins/io_file/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/engineconn-plugins/io_file/src/main/resources/log4j2.xml
index 14b31cd7d..ec619c7c7 100644
--- a/linkis-engineconn-plugins/engineconn-plugins/io_file/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/engineconn-plugins/io_file/src/main/resources/log4j2.xml
@@ -18,10 +18,15 @@
   
 <configuration status="error" monitorInterval="30">
     <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
-            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M - %msg%xEx%n"/>
-        </Console>
+        <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
+                     filePattern="${env:LOG_DIRS}/$${date:yyyy-MM}/linkis-log-%d{yyyy-MM-dd-hh}-%i.log">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
 
         <Send name="Send" >
             <Filters>
@@ -37,7 +42,7 @@
     </appenders>
     <loggers>
         <root level="INFO">
-             <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFile"/>
              <appender-ref ref="stderr"/>
         </root>
 
diff --git a/linkis-engineconn-plugins/engineconn-plugins/jdbc/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/engineconn-plugins/jdbc/src/main/resources/log4j2.xml
index 7d6fb5626..20c984c12 100644
--- a/linkis-engineconn-plugins/engineconn-plugins/jdbc/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/engineconn-plugins/jdbc/src/main/resources/log4j2.xml
@@ -18,10 +18,15 @@
   
 <configuration status="error" monitorInterval="30">
     <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
-            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M - %msg%xEx%n"/>
-        </Console>
+        <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
+                     filePattern="${env:LOG_DIRS}/$${date:yyyy-MM}/linkis-log-%d{yyyy-MM-dd-hh}-%i.log">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
 
         <Send name="Send" >
             <Filters>
@@ -38,7 +43,7 @@
     <loggers>
         <root level="INFO">
             <appender-ref ref="stderr"/>
-            <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFile"/>
             <appender-ref ref="Send"/>
         </root>
         <logger name="org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter" level="error" additivity="true">
diff --git a/linkis-engineconn-plugins/engineconn-plugins/pipeline/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/engineconn-plugins/pipeline/src/main/resources/log4j2.xml
index 5c16cbaa5..4fb9ed413 100644
--- a/linkis-engineconn-plugins/engineconn-plugins/pipeline/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/engineconn-plugins/pipeline/src/main/resources/log4j2.xml
@@ -18,10 +18,15 @@
   
 <configuration status="error" monitorInterval="30">
     <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
-            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M - %msg%xEx%n"/>
-        </Console>
+        <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
+                     filePattern="${env:LOG_DIRS}/$${date:yyyy-MM}/linkis-log-%d{yyyy-MM-dd-hh}-%i.log">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
 
         <Send name="Send" >
             <Filters>
@@ -38,7 +43,7 @@
     <loggers>
         <root level="INFO">
             <appender-ref ref="stderr"/>
-            <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFile"/>
             <appender-ref ref="Send"/>
         </root>
         <logger name="org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter" level="error" additivity="true">
diff --git a/linkis-engineconn-plugins/engineconn-plugins/python/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/engineconn-plugins/python/src/main/resources/log4j2.xml
index 700575597..e4a88cf60 100644
--- a/linkis-engineconn-plugins/engineconn-plugins/python/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/engineconn-plugins/python/src/main/resources/log4j2.xml
@@ -18,10 +18,15 @@
   
 <configuration status="error" monitorInterval="30">
     <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
-            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M - %msg%xEx%n"/>
-        </Console>
+        <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
+                     filePattern="${env:LOG_DIRS}/$${date:yyyy-MM}/linkis-log-%d{yyyy-MM-dd-hh}-%i.log">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
 
         <Send name="Send">
             <Filters>
@@ -38,7 +43,7 @@
     <loggers>
         <root level="INFO">
             <appender-ref ref="stderr"/>
-            <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFile"/>
             <appender-ref ref="Send"/>
         </root>
 
diff --git a/linkis-engineconn-plugins/engineconn-plugins/shell/src/main/resources/conf/log4j2.xml b/linkis-engineconn-plugins/engineconn-plugins/shell/src/main/resources/conf/log4j2.xml
index 4b5329575..c2770787e 100644
--- a/linkis-engineconn-plugins/engineconn-plugins/shell/src/main/resources/conf/log4j2.xml
+++ b/linkis-engineconn-plugins/engineconn-plugins/shell/src/main/resources/conf/log4j2.xml
@@ -18,10 +18,15 @@
   
 <configuration status="error" monitorInterval="30">
     <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
-            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M - %msg%xEx%n"/>
-        </Console>
+        <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
+                     filePattern="${env:LOG_DIRS}/$${date:yyyy-MM}/linkis-log-%d{yyyy-MM-dd-hh}-%i.log">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
 
         <Send name="Send" >
             <Filters>
@@ -38,7 +43,7 @@
     <loggers>
         <root level="INFO">
             <appender-ref ref="stderr"/>
-            <appender-ref ref="Console"/>
+            <appender-ref ref="RollingFile"/>
             <appender-ref ref="Send"/>
         </root>
         <logger name="org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter" level="error" additivity="true">
diff --git a/linkis-engineconn-plugins/engineconn-plugins/spark/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/engineconn-plugins/spark/src/main/resources/log4j2.xml
index 06c216bed..5a398b3be 100644
--- a/linkis-engineconn-plugins/engineconn-plugins/spark/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/engineconn-plugins/spark/src/main/resources/log4j2.xml
@@ -18,10 +18,15 @@
   
 <configuration status="error" monitorInterval="30">
     <appenders>
-        <Console name="Console" target="SYSTEM_OUT">
-            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
-            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%t] %logger{36} %L %M - %msg%xEx%n"/>
-        </Console>
+        <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
+                     filePattern="${env:LOG_DIRS}/$${date:yyyy-MM}/linkis-log-%d{yyyy-MM-dd-hh}-%i.log">
+            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
+            <Policies>
+                <TimeBasedTriggeringPolicy interval="1"/>
+                <SizeBasedTriggeringPolicy size="100MB"/>
+            </Policies>
+            <DefaultRolloverStrategy max="10"/>
+        </RollingFile>
 
         <Send name="Send" >
             <Filters>
@@ -42,7 +47,7 @@
     <loggers>
       <root level="INFO">
             <appender-ref ref="stderr"/>
-            <appender-ref ref="Console"/>
+          <appender-ref ref="RollingFile"/>
             <appender-ref ref="Send"/>
         </root>
         <logger name="org.apache.hadoop.yarn.util.RackResolver" level="warn" additivity="true">


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org