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: [email protected]

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


Reply via email to