ankuriitg commented on a change in pull request #23675: [SPARK-26753][CORE]
Fixed custom log levels for spark-shell by using Filter instead of Threshold
URL: https://github.com/apache/spark/pull/23675#discussion_r251959594
##########
File path: core/src/main/scala/org/apache/spark/util/Utils.scala
##########
@@ -2285,7 +2287,15 @@ private[spark] object Utils extends Logging {
val rootLogger = org.apache.log4j.Logger.getRootLogger()
rootLogger.setLevel(l)
rootLogger.getAllAppenders().asScala.foreach {
- case ca: org.apache.log4j.ConsoleAppender => ca.setThreshold(l)
+ case ca: org.apache.log4j.ConsoleAppender =>
+ var f = ca.getFirstFilter()
+ while (f != null) {
+ f match {
+ case ssf: SparkShellLoggingFilter =>
Review comment:
Thanks, that does make it simpler
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]