hailin0 commented on code in PR #3025:
URL: 
https://github.com/apache/incubator-seatunnel/pull/3025#discussion_r990949932


##########
config/log4j2-file.properties:
##########
@@ -0,0 +1,51 @@
+################################################################################
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+
+property.file_path = logs
+property.file_name = seatunnel
+property.file_split_size = 100MB
+property.file_count = 100
+property.file_ttl = 7d

Review Comment:
   log files:
   max bytes = 100MB * 10
   max times = 7d



##########
seatunnel-core/seatunnel-starter/pom.xml:
##########
@@ -52,10 +52,45 @@
             <artifactId>seatunnel-engine-server</artifactId>
             <version>${project.version}</version>
         </dependency>
+
+        <!-- Declare log4j2 asynchronous loggers provider: disruptor -->
+        <dependency>
+            <groupId>com.lmax</groupId>
+            <artifactId>disruptor</artifactId>
+        </dependency>
+
     </dependencies>
 
     <build>
         <finalName>${project.name}</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-shade-plugin</artifactId>
+                <configuration>
+                    <artifactSet>
+                        <excludes>
+                            <!-- not excluded slf4j-api & log4j2 & bridges -->
+                            <exclude>org.slf4j:slf4j-jdk14</exclude>
+                            <exclude>org.slf4j:slf4j-nop</exclude>
+                            <exclude>org.slf4j:slf4j-simple</exclude>
+                            <exclude>org.slf4j:slf4j-reload4j</exclude>
+                            <exclude>org.slf4j:slf4j-log4j12</exclude>
+                            <exclude>log4j:*</exclude>
+                            <exclude>commons-logging:*</exclude>
+                            <exclude>ch.qos.logback:*</exclude>
+                            <!--  -->
+                            
<exclude>org.apache.logging.log4j:log4j-to-slf4j</exclude>
+                        </excludes>
+                    </artifactSet>
+                </configuration>

Review Comment:
   Override the parent's configuration
   
   include: slf4j-api & log4j2



##########
seatunnel-core/pom.xml:
##########
@@ -31,21 +31,31 @@
     <packaging>pom</packaging>
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>copy-starter-logging-package-for-e2e</id>
+                            <phase>package</phase>
+                            <goals>
+                                <goal>copy-dependencies</goal>
+                            </goals>
+                            <configuration>
+                                
<includeGroupIds>org.slf4j,org.apache.logging.log4j</includeGroupIds>
+                                
<outputDirectory>${project.build.directory}/logging-e2e</outputDirectory>

Review Comment:
   use by e2e



##########
seatunnel-core/pom.xml:
##########
@@ -31,21 +31,31 @@
     <packaging>pom</packaging>
 
     <build>
+        <pluginManagement>
+            <plugins>
+                <plugin>
+                    <groupId>org.apache.maven.plugins</groupId>
+                    <artifactId>maven-dependency-plugin</artifactId>
+                    <executions>
+                        <execution>
+                            <id>copy-starter-logging-package-for-e2e</id>
+                            <phase>package</phase>
+                            <goals>
+                                <goal>copy-dependencies</goal>
+                            </goals>
+                            <configuration>
+                                
<includeGroupIds>org.slf4j,org.apache.logging.log4j</includeGroupIds>
+                                
<outputDirectory>${project.build.directory}/logging-e2e</outputDirectory>
+                            </configuration>
+                        </execution>
+                    </executions>
+                </plugin>
+            </plugins>
+        </pluginManagement>
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
-                <configuration>
-                    <shadedArtifactAttached>false</shadedArtifactAttached>
-                    
<createDependencyReducedPom>true</createDependencyReducedPom>
-                    <!-- Make sure the transitive dependencies are written to 
the generated pom under <dependencies> -->
-                    
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
-                    <artifactSet>
-                        <excludes>
-                            <exclude>ch.qos.logback:*</exclude>
-                        </excludes>
-                    </artifactSet>
-                </configuration>

Review Comment:
   configuration from extends parent pom



##########
seatunnel-core/seatunnel-starter/src/main/bin/seatunnel-cluster.sh:
##########
@@ -60,4 +60,14 @@ if [ -z $SEATUNNEL_CONFIG ]; then
     SEATUNNEL_CONFIG=${CONF_DIR}/seatunnel.yaml
 fi
 
-java -Dseatunnel.config=${SEATUNNEL_CONFIG} 
-Dhazelcast.config=${HAZELCAST_CONFIG} -cp ${APP_JAR} ${APP_MAIN} ${args}
+if [ -z $LOG4J2_CONFIG ]; then
+    LOG4J2_CONFIG=${CONF_DIR}/log4j2-file.properties
+fi
+
+if [ -z $LOG4J2_CONTEXT_SELECTOR ]; then
+    
LOG4J2_CONTEXT_SELECTOR="org.apache.logging.log4j.core.async.AsyncLoggerContextSelector"

Review Comment:
   Enable async logger



##########
seatunnel-engine/seatunnel-engine-common/src/main/resources/hazelcast.yaml:
##########
@@ -17,7 +17,14 @@
 
 hazelcast:
   cluster-name: seatunnel
+  properties:
+    hazelcast.logging.type: log4j2
   network:
+    rest-api:
+      enabled: true
+      endpoint-groups:
+        CLUSTER_WRITE:
+          enabled: true

Review Comment:
   Enable API:       POST /hazelcast/rest/log-level



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to