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

jinsongzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new 4b657514f [AMORO-3612][Improvement]: Add the log output function of 
the StandaloneOptimizer module (#3613)
4b657514f is described below

commit 4b657514f380f3d13a581c80ff55f0214ce82c8e
Author: cxxiii <[email protected]>
AuthorDate: Tue Jun 17 19:18:24 2025 +0800

    [AMORO-3612][Improvement]: Add the log output function of the 
StandaloneOptimizer module (#3613)
    
    * Change the url of quickstart
    
    * Change the url of quickstart
    
    * Add the log output function of the StandaloneOptimizer module
    
    * Fix formatting issues
    
    * Correct some configuration information and reduce unnecessary log output
    
    * remove unnecessary code
    
    ---------
    
    Co-authored-by: ZhouJinsong <[email protected]>
---
 amoro-optimizer/amoro-optimizer-standalone/pom.xml | 33 ++++++++++++++++++
 .../optimizer/standalone/StandaloneOptimizer.java  |  1 +
 .../src/main/resources/log4j2.xml                  | 40 ++++++++++++++++++++++
 3 files changed, 74 insertions(+)

diff --git a/amoro-optimizer/amoro-optimizer-standalone/pom.xml 
b/amoro-optimizer/amoro-optimizer-standalone/pom.xml
index 1f52f02b4..7fff47251 100644
--- a/amoro-optimizer/amoro-optimizer-standalone/pom.xml
+++ b/amoro-optimizer/amoro-optimizer-standalone/pom.xml
@@ -50,6 +50,25 @@
             <artifactId>snakeyaml</artifactId>
         </dependency>
 
+
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-slf4j-impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-api</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.logging.log4j</groupId>
+            <artifactId>log4j-core</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.amoro</groupId>
             <artifactId>amoro-common</artifactId>
@@ -58,4 +77,18 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>log4j2.xml</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
 </project>
diff --git 
a/amoro-optimizer/amoro-optimizer-standalone/src/main/java/org/apache/amoro/optimizer/standalone/StandaloneOptimizer.java
 
b/amoro-optimizer/amoro-optimizer-standalone/src/main/java/org/apache/amoro/optimizer/standalone/StandaloneOptimizer.java
index 9a120ec07..b38d0fc42 100644
--- 
a/amoro-optimizer/amoro-optimizer-standalone/src/main/java/org/apache/amoro/optimizer/standalone/StandaloneOptimizer.java
+++ 
b/amoro-optimizer/amoro-optimizer-standalone/src/main/java/org/apache/amoro/optimizer/standalone/StandaloneOptimizer.java
@@ -27,6 +27,7 @@ import java.lang.management.ManagementFactory;
 import java.lang.management.RuntimeMXBean;
 
 public class StandaloneOptimizer {
+
   public static void main(String[] args) throws CmdLineException {
     OptimizerConfig optimizerConfig = new OptimizerConfig(args);
     Optimizer optimizer = new Optimizer(optimizerConfig);
diff --git 
a/amoro-optimizer/amoro-optimizer-standalone/src/main/resources/log4j2.xml 
b/amoro-optimizer/amoro-optimizer-standalone/src/main/resources/log4j2.xml
new file mode 100644
index 000000000..98cb3bae0
--- /dev/null
+++ b/amoro-optimizer/amoro-optimizer-standalone/src/main/resources/log4j2.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<Configuration>
+    <properties>
+        <property name="LOG_HOME">logs</property>
+    </properties>
+
+    <Appenders>
+        <!--*********************Console log***********************-->
+        <Console name="consoleAppender" target="SYSTEM_OUT">
+            <!--Set log format and color-->
+            <PatternLayout
+                    pattern="%d %p [%t] [%logger{39}] [%X{RequestId}] - %m%n"/>
+        </Console>
+    </Appenders>
+
+    <Loggers>
+        <Root level="debug">
+            <AppenderRef ref="consoleAppender" level="info"/>
+        </Root>
+    </Loggers>
+
+</Configuration>

Reply via email to