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 2023/04/14 15:05:05 UTC

[linkis] branch dev-1.4.0 updated: optimize engine log (#4455)

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

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


The following commit(s) were added to refs/heads/dev-1.4.0 by this push:
     new 0f1005c43 optimize engine log (#4455)
0f1005c43 is described below

commit 0f1005c4310a527f73ff3e060e11ab49d4e60650
Author: huangKai-2323 <62...@users.noreply.github.com>
AuthorDate: Fri Apr 14 23:04:58 2023 +0800

    optimize engine log (#4455)
---
 .../ecm/server/service/impl/DefaultEngineConnKillService.java     | 8 ++++----
 .../launch/process/JavaProcessEngineConnLaunchBuilder.scala       | 2 +-
 .../java/org/apache/linkis/manager/am/restful/EMRestfulApi.java   | 5 ++++-
 linkis-engineconn-plugins/hive/src/main/resources/log4j2.xml      | 4 ++--
 .../shell/src/main/resources/conf/log4j2.xml                      | 4 ++--
 linkis-engineconn-plugins/spark/src/main/resources/log4j2.xml     | 4 ++--
 linkis-engineconn-plugins/sqoop/src/main/resources/log4j2.xml     | 2 +-
 7 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/linkis-computation-governance/linkis-engineconn-manager/linkis-engineconn-manager-server/src/main/scala/org/apache/linkis/ecm/server/service/impl/DefaultEngineConnKillService.java b/linkis-computation-governance/linkis-engineconn-manager/linkis-engineconn-manager-server/src/main/scala/org/apache/linkis/ecm/server/service/impl/DefaultEngineConnKillService.java
index 4f593736d..3c335abf4 100644
--- a/linkis-computation-governance/linkis-engineconn-manager/linkis-engineconn-manager-server/src/main/scala/org/apache/linkis/ecm/server/service/impl/DefaultEngineConnKillService.java
+++ b/linkis-computation-governance/linkis-engineconn-manager/linkis-engineconn-manager-server/src/main/scala/org/apache/linkis/ecm/server/service/impl/DefaultEngineConnKillService.java
@@ -5,16 +5,16 @@
  * 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.
  */
- 
+
 package org.apache.linkis.ecm.server.service.impl;
 
 import org.apache.commons.io.IOUtils;
@@ -98,7 +98,7 @@ public class DefaultEngineConnKillService implements EngineConnKillService {
         String engineConnInstance = engineConn.getServiceInstance().toString();
         logger.info("try to kill yarn app ids in the engine of ({}).", engineConnInstance);
         String engineLogDir = engineConn.getEngineConnManagerEnv().engineConnLogDirs();
-        final String errEngineLogPath = engineLogDir.concat(File.separator).concat("yarnApp.log");
+        final String errEngineLogPath = engineLogDir.concat(File.separator).concat("yarnApp");
         logger.info("try to parse the yarn app id from the engine err log file path: {}", errEngineLogPath);
         File file = new File(errEngineLogPath);
         if (file.exists())
diff --git a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/scala/org/apache/linkis/manager/engineplugin/common/launch/process/JavaProcessEngineConnLaunchBuilder.scala b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/scala/org/apache/linkis/manager/engineplugin/common/launch/process/JavaProcessEngineConnLaunchBuilder.scala
index 5271ec37e..082b02a02 100644
--- a/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/scala/org/apache/linkis/manager/engineplugin/common/launch/process/JavaProcessEngineConnLaunchBuilder.scala
+++ b/linkis-computation-governance/linkis-engineconn/linkis-engineconn-plugin-core/src/main/scala/org/apache/linkis/manager/engineplugin/common/launch/process/JavaProcessEngineConnLaunchBuilder.scala
@@ -53,7 +53,7 @@ abstract class JavaProcessEngineConnLaunchBuilder
     this.engineConnResourceGenerator = engineConnResourceGenerator
 
   protected def getGcLogDir(engineConnBuildRequest: EngineConnBuildRequest): String =
-    variable(LOG_DIRS) + "/gc.log"
+    variable(LOG_DIRS) + "/gc"
 
   protected def getLogDir(engineConnBuildRequest: EngineConnBuildRequest): String =
     s" -Dlogging.file=${EnvConfiguration.LOG4J2_XML_FILE.getValue} " +
diff --git a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/restful/EMRestfulApi.java b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/restful/EMRestfulApi.java
index 4d8bbad27..4477d60ef 100644
--- a/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/restful/EMRestfulApi.java
+++ b/linkis-computation-governance/linkis-manager/linkis-application-manager/src/main/java/org/apache/linkis/manager/am/restful/EMRestfulApi.java
@@ -392,7 +392,10 @@ public class EMRestfulApi {
                   jsonNode.get("parameters").toString(),
                   new TypeReference<Map<String, Object>>() {});
       String logType = (String) parameters.get("logType");
-      if (!logType.equals("stdout") && !logType.equals("stderr")) {
+      if (!logType.equals("stdout")
+          && !logType.equals("stderr")
+          && !logType.equals("gc")
+          && !logType.equals("yarnApp")) {
         throw new AMErrorException(
             AMErrorCode.PARAM_ERROR.getErrorCode(), AMErrorCode.PARAM_ERROR.getErrorDesc());
       }
diff --git a/linkis-engineconn-plugins/hive/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/hive/src/main/resources/log4j2.xml
index e6f8b150f..50a36c0ed 100644
--- a/linkis-engineconn-plugins/hive/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/hive/src/main/resources/log4j2.xml
@@ -15,7 +15,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
-  
+
 <configuration status="error" monitorInterval="30">
     <appenders>
         <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS:-logs}/stdout"
@@ -27,7 +27,7 @@
             <DefaultRolloverStrategy max="10"/>
         </RollingFile>
 
-        <File name="YarnAppIdOutputFile" append="true" fileName="${env:LOG_DIRS:-logs}/yarnApp.log">
+        <File name="YarnAppIdOutputFile" append="true" fileName="${env:LOG_DIRS:-logs}/yarnApp">
             <RegexFilter regex=".*application_.*" onMatch="ACCEPT" onMismatch="DENY"/>
             <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
         </File>
diff --git a/linkis-engineconn-plugins/shell/src/main/resources/conf/log4j2.xml b/linkis-engineconn-plugins/shell/src/main/resources/conf/log4j2.xml
index 68173f23a..ee7557457 100644
--- a/linkis-engineconn-plugins/shell/src/main/resources/conf/log4j2.xml
+++ b/linkis-engineconn-plugins/shell/src/main/resources/conf/log4j2.xml
@@ -15,7 +15,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
-  
+
 <configuration status="error" monitorInterval="30">
     <appenders>
         <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS}/stdout"
@@ -27,7 +27,7 @@
             <DefaultRolloverStrategy max="10"/>
         </RollingFile>
 
-        <File name="YarnAppIdOutputFile" append="true" fileName="${env:LOG_DIRS}/yarnApp.log">
+        <File name="YarnAppIdOutputFile" append="true" fileName="${env:LOG_DIRS}/yarnApp">
             <RegexFilter regex=".* application .*" onMatch="ACCEPT" onMismatch="DENY"/>
             <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
         </File>
diff --git a/linkis-engineconn-plugins/spark/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/spark/src/main/resources/log4j2.xml
index b02d5889c..1158cefb5 100644
--- a/linkis-engineconn-plugins/spark/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/spark/src/main/resources/log4j2.xml
@@ -15,7 +15,7 @@
   ~ See the License for the specific language governing permissions and
   ~ limitations under the License.
   -->
-  
+
 <configuration status="error" monitorInterval="30">
     <appenders>
         <RollingFile name="RollingFile" append="true" fileName="${env:LOG_DIRS:-logs}/stdout"
@@ -27,7 +27,7 @@
             <DefaultRolloverStrategy max="10"/>
         </RollingFile>
 
-        <File name="YarnAppIdOutputFile" append="true" fileName="${env:LOG_DIRS:-logs}/yarnApp.log">
+        <File name="YarnAppIdOutputFile" append="true" fileName="${env:LOG_DIRS:-logs}/yarnApp">
             <RegexFilter regex=".* application .*" onMatch="ACCEPT" onMismatch="DENY"/>
             <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
         </File>
diff --git a/linkis-engineconn-plugins/sqoop/src/main/resources/log4j2.xml b/linkis-engineconn-plugins/sqoop/src/main/resources/log4j2.xml
index 9fd15a4b4..d93effc17 100644
--- a/linkis-engineconn-plugins/sqoop/src/main/resources/log4j2.xml
+++ b/linkis-engineconn-plugins/sqoop/src/main/resources/log4j2.xml
@@ -34,7 +34,7 @@
             <PatternLayout pattern="%d{HH:mm:ss.SSS} %-5level %class{36} %L %M - %msg%xEx%n"/>
         </File>
 
-        <File name="YarnAppIdOutputFile" append="true" fileName="${env:LOG_DIRS}/yarnApp.log">
+        <File name="YarnAppIdOutputFile" append="true" fileName="${env:LOG_DIRS}/yarnApp">
             <RegexFilter regex=".* application .*" onMatch="ACCEPT" onMismatch="DENY"/>
             <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] [%-40t] %c{1.} (%L) [%M] - %msg%xEx%n"/>
         </File>


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