You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "AngersZhuuuu (via GitHub)" <gi...@apache.org> on 2023/12/26 07:21:52 UTC

[PR] [SPARK-46510][CORE] Spark shell log filter should be applied to all AbstractAppender [spark]

AngersZhuuuu opened a new pull request, #44496:
URL: https://github.com/apache/spark/pull/44496

   ### What changes were proposed in this pull request?
   Current code `SparkShellLoggingFilter` only applied to `ConsoleAppender`, if we define `AsyncAppender` and ref to console appender it won't work. I think here we should apply  `SparkShellLoggingFilter` to all `AbstractAppender` since all of them support `addFilter()`
   
   
   ### Why are the changes needed?
   Support more use case
   
   
   ### Does this PR introduce _any_ user-facing change?
   User can use the feature of shell in all log4j configuration.
   
   ### How was this patch tested?
   MT
   
   ### Was this patch authored or co-authored using generative AI tooling?
   No


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46510][CORE] Spark shell log filter should be applied to all AbstractAppender [spark]

Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on code in PR #44496:
URL: https://github.com/apache/spark/pull/44496#discussion_r1436363784


##########
common/utils/src/main/scala/org/apache/spark/internal/Logging.scala:
##########
@@ -169,8 +169,8 @@ trait Logging {
           }
           Logging.sparkShellThresholdLevel = replLevel
           rootLogger.getAppenders().asScala.foreach {
-            case (_, ca: ConsoleAppender) =>
-              ca.addFilter(new SparkShellLoggingFilter())
+            case (_, appender: AbstractAppender) =>
+              appender.addFilter(new SparkShellLoggingFilter())

Review Comment:
   +1



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46510][CORE] Spark shell log filter should be applied to all AbstractAppender [spark]

Posted by "AngersZhuuuu (via GitHub)" <gi...@apache.org>.
AngersZhuuuu commented on code in PR #44496:
URL: https://github.com/apache/spark/pull/44496#discussion_r1436378705


##########
common/utils/src/main/scala/org/apache/spark/internal/Logging.scala:
##########
@@ -169,8 +169,8 @@ trait Logging {
           }
           Logging.sparkShellThresholdLevel = replLevel
           rootLogger.getAppenders().asScala.foreach {
-            case (_, ca: ConsoleAppender) =>
-              ca.addFilter(new SparkShellLoggingFilter())
+            case (_, appender: AbstractAppender) =>
+              appender.addFilter(new SparkShellLoggingFilter())

Review Comment:
   > Doesn't this add the filter to all appenders of the root logger? I think the original intention here is to only add the filter to console only. I think by doing this, the logging of other appenders will be affected.
   
   AsyncAppender -> ConsoleAppender then can't work....hmmm



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46510][CORE] Spark shell log filter should be applied to all AbstractAppender [spark]

Posted by "viirya (via GitHub)" <gi...@apache.org>.
viirya commented on code in PR #44496:
URL: https://github.com/apache/spark/pull/44496#discussion_r1436335619


##########
common/utils/src/main/scala/org/apache/spark/internal/Logging.scala:
##########
@@ -169,8 +169,8 @@ trait Logging {
           }
           Logging.sparkShellThresholdLevel = replLevel
           rootLogger.getAppenders().asScala.foreach {
-            case (_, ca: ConsoleAppender) =>
-              ca.addFilter(new SparkShellLoggingFilter())
+            case (_, appender: AbstractAppender) =>
+              appender.addFilter(new SparkShellLoggingFilter())

Review Comment:
   Doesn't this add the filter to all appenders of the root logger? I think the original intention here is to only add the filter to console only. I think by doing this, the logging of other appenders will be affected.



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46510][CORE] Spark shell log filter should be applied to all AbstractAppender [spark]

Posted by "AngersZhuuuu (via GitHub)" <gi...@apache.org>.
AngersZhuuuu closed pull request #44496: [SPARK-46510][CORE] Spark shell log filter should be applied to all AbstractAppender
URL: https://github.com/apache/spark/pull/44496


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46510][CORE] Spark shell log filter should be applied to all AbstractAppender [spark]

Posted by "LuciferYang (via GitHub)" <gi...@apache.org>.
LuciferYang commented on PR #44496:
URL: https://github.com/apache/spark/pull/44496#issuecomment-1869346457

   Is this an improvement rather than a bug fix? Does the `Affects Version` not include 3.5.0? Can you provide some screenshots to show the differences before and after? For example, what are the changes when using `AsyncAppender `?


-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Re: [PR] [SPARK-46510][CORE] Spark shell log filter should be applied to all AbstractAppender [spark]

Posted by "yaooqinn (via GitHub)" <gi...@apache.org>.
yaooqinn commented on code in PR #44496:
URL: https://github.com/apache/spark/pull/44496#discussion_r1436345878


##########
common/utils/src/main/scala/org/apache/spark/internal/Logging.scala:
##########
@@ -169,8 +169,8 @@ trait Logging {
           }
           Logging.sparkShellThresholdLevel = replLevel
           rootLogger.getAppenders().asScala.foreach {
-            case (_, ca: ConsoleAppender) =>
-              ca.addFilter(new SparkShellLoggingFilter())
+            case (_, appender: AbstractAppender) =>
+              appender.addFilter(new SparkShellLoggingFilter())

Review Comment:
   +1, for console only



-- 
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: reviews-unsubscribe@spark.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org