You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/01/29 00:28:21 UTC
[GitHub] vanzin commented on a change in pull request #23675:
[SPARK-26753][CORE] Fix for ensuring custom log levels work for spark-shell
vanzin commented on a change in pull request #23675: [SPARK-26753][CORE] Fix for ensuring custom log levels work for spark-shell
URL: https://github.com/apache/spark/pull/23675#discussion_r251648478
##########
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:
This match is not exhaustive. It will throw an exception if there's another filter.
It might be simpler to keep the current log level in the `Logging` object; that way the filter does not need to be mutable, and this code would just set that variable.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org