You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/07/19 08:04:24 UTC

[GitHub] [incubator-kyuubi] zwangsheng opened a new pull request #831: [K8s] [KYUUBI #828] Manage Spark-Block-Cleaner log files

zwangsheng opened a new pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831


   ### _Why are the changes needed?_
   Spark-Block-Cleaner log files are not governed by itself.
   Add log4j-defaults.properties to help input both console and file.
   And use rollingFileApeender to split big logfile to small logFiles.
   Create a log file under /logs/spark-block-cleaner-log/ so that you can manage the log yourself with the ability to clear the folder leading to `spark-`.  
   
   ### _How was this patch tested?_
   - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
   
   - [ ] Add screenshots for manual tests if appropriate
   
   - [X] [Run test](https://kyuubi.readthedocs.io/en/latest/tools/testing.html#running-tests) locally before make a pull request
   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#discussion_r672094691



##########
File path: tools/spark-block-cleaner/src/main/resources/log4j-defaults.properties
##########
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+# Set everything to be logged to the console
+log4j.rootCategory=INFO, console, logFile
+
+### console
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c{2}: %m%n
+
+### logFile
+log4j.appender.logFile=org.apache.log4j.RollingFileAppender
+log4j.appender.logFile.File=/logs/spark-block-cleaner-log/cleaner-log.out
+log4j.appender.logFile.MaxFileSize=100MB
+log4j.appender.logFile.MaxBackupIndex=5
+log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.logFile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c{2}: %m%n
+
+# SPARK-34128:Suppress undesirable TTransportException warnings involved in THRIFT-4805
+log4j.appender.console.filter.1=org.apache.log4j.varia.StringMatchFilter
+log4j.appender.console.filter.1.StringToMatch=Thrift error occurred during processing of message
+log4j.appender.console.filter.1.AcceptOnMatch=false

Review comment:
       unnecessary

##########
File path: tools/spark-block-cleaner/src/main/resources/log4j-defaults.properties
##########
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+# Set everything to be logged to the console
+log4j.rootCategory=INFO, console, logFile
+
+### console
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err

Review comment:
       `System.out`

##########
File path: tools/spark-block-cleaner/src/main/resources/log4j-defaults.properties
##########
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+# Set everything to be logged to the console
+log4j.rootCategory=INFO, console, logFile
+
+### console
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c{2}: %m%n
+
+### logFile
+log4j.appender.logFile=org.apache.log4j.RollingFileAppender
+log4j.appender.logFile.File=/logs/spark-block-cleaner-log/cleaner-log.out
+log4j.appender.logFile.MaxFileSize=100MB

Review comment:
       100MB * 5 looks a little big, 20MB * 5 ?

##########
File path: tools/spark-block-cleaner/src/main/scala/org/apache/kyuubi/tools/KubernetesSparkBlockCleaner.scala
##########
@@ -20,8 +20,8 @@ package org.apache.kyuubi.tools
 import java.io.File
 import java.nio.file.{Files, Paths}
 import java.util.concurrent.{CountDownLatch, Executors}
-
 import org.apache.kyuubi.Logging
+import org.apache.log4j.PropertyConfigurator

Review comment:
       ```
   import org.apache.log4j.PropertyConfigurator
   
   import org.apache.kyuubi.Logging
   ```

##########
File path: tools/spark-block-cleaner/src/main/scala/org/apache/kyuubi/tools/KubernetesSparkBlockCleaner.scala
##########
@@ -175,6 +175,8 @@ object KubernetesSparkBlockCleaner extends Logging {
 
   def main(args: Array[String]): Unit = {
     do {
+      PropertyConfigurator.configure(
+        Thread.currentThread().getContextClassLoader.getResource("log4j-block-cleaner.properties"))

Review comment:
       just make this code as static initialization block




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#issuecomment-882434836


   thanks, merging to master for v1.3.0


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you closed pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831


   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you closed pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
ulysses-you closed pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831


   


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] zwangsheng commented on a change in pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
zwangsheng commented on a change in pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#discussion_r672131734



##########
File path: tools/spark-block-cleaner/src/main/scala/org/apache/kyuubi/tools/KubernetesSparkBlockCleaner.scala
##########
@@ -20,8 +20,8 @@ package org.apache.kyuubi.tools
 import java.io.File
 import java.nio.file.{Files, Paths}
 import java.util.concurrent.{CountDownLatch, Executors}
-
 import org.apache.kyuubi.Logging
+import org.apache.log4j.PropertyConfigurator

Review comment:
       done




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#discussion_r672094691



##########
File path: tools/spark-block-cleaner/src/main/resources/log4j-defaults.properties
##########
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+# Set everything to be logged to the console
+log4j.rootCategory=INFO, console, logFile
+
+### console
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c{2}: %m%n
+
+### logFile
+log4j.appender.logFile=org.apache.log4j.RollingFileAppender
+log4j.appender.logFile.File=/logs/spark-block-cleaner-log/cleaner-log.out
+log4j.appender.logFile.MaxFileSize=100MB
+log4j.appender.logFile.MaxBackupIndex=5
+log4j.appender.logFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.logFile.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c{2}: %m%n
+
+# SPARK-34128:Suppress undesirable TTransportException warnings involved in THRIFT-4805
+log4j.appender.console.filter.1=org.apache.log4j.varia.StringMatchFilter
+log4j.appender.console.filter.1.StringToMatch=Thrift error occurred during processing of message
+log4j.appender.console.filter.1.AcceptOnMatch=false

Review comment:
       unnecessary

##########
File path: tools/spark-block-cleaner/src/main/resources/log4j-defaults.properties
##########
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+# Set everything to be logged to the console
+log4j.rootCategory=INFO, console, logFile
+
+### console
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err

Review comment:
       `System.out`

##########
File path: tools/spark-block-cleaner/src/main/resources/log4j-defaults.properties
##########
@@ -0,0 +1,38 @@
+#
+# 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.
+#
+
+# Set everything to be logged to the console
+log4j.rootCategory=INFO, console, logFile
+
+### console
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.target=System.err
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %p %c{2}: %m%n
+
+### logFile
+log4j.appender.logFile=org.apache.log4j.RollingFileAppender
+log4j.appender.logFile.File=/logs/spark-block-cleaner-log/cleaner-log.out
+log4j.appender.logFile.MaxFileSize=100MB

Review comment:
       100MB * 5 looks a little big, 20MB * 5 ?




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#discussion_r672129946



##########
File path: tools/spark-block-cleaner/src/main/scala/org/apache/kyuubi/tools/KubernetesSparkBlockCleaner.scala
##########
@@ -20,8 +20,8 @@ package org.apache.kyuubi.tools
 import java.io.File
 import java.nio.file.{Files, Paths}
 import java.util.concurrent.{CountDownLatch, Executors}
-
 import org.apache.kyuubi.Logging
+import org.apache.log4j.PropertyConfigurator

Review comment:
       ```
   import org.apache.log4j.PropertyConfigurator
   
   import org.apache.kyuubi.Logging
   ```




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] zwangsheng commented on a change in pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
zwangsheng commented on a change in pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#discussion_r672131734



##########
File path: tools/spark-block-cleaner/src/main/scala/org/apache/kyuubi/tools/KubernetesSparkBlockCleaner.scala
##########
@@ -20,8 +20,8 @@ package org.apache.kyuubi.tools
 import java.io.File
 import java.nio.file.{Files, Paths}
 import java.util.concurrent.{CountDownLatch, Executors}
-
 import org.apache.kyuubi.Logging
+import org.apache.log4j.PropertyConfigurator

Review comment:
       done




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on a change in pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on a change in pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#discussion_r672131511



##########
File path: tools/spark-block-cleaner/src/main/scala/org/apache/kyuubi/tools/KubernetesSparkBlockCleaner.scala
##########
@@ -175,6 +175,8 @@ object KubernetesSparkBlockCleaner extends Logging {
 
   def main(args: Array[String]): Unit = {
     do {
+      PropertyConfigurator.configure(
+        Thread.currentThread().getContextClassLoader.getResource("log4j-block-cleaner.properties"))

Review comment:
       just make this code as static initialization block




-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] ulysses-you commented on pull request #831: [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
ulysses-you commented on pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#issuecomment-882434836


   thanks, merging to master for v1.3.0


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-kyuubi] zwangsheng commented on pull request #831: [K8s] [KYUUBI #828] Manage Spark-Block-Cleaner log files

Posted by GitBox <gi...@apache.org>.
zwangsheng commented on pull request #831:
URL: https://github.com/apache/incubator-kyuubi/pull/831#issuecomment-882335213


   cc @ulysses-you @yaooqinn 


-- 
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: commits-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org