Mikael Ståldal created SPARK-16416: --------------------------------------
Summary: Logging in shutdown hook does not work properly with Log4j 2.x Key: SPARK-16416 URL: https://issues.apache.org/jira/browse/SPARK-16416 Project: Spark Issue Type: Bug Components: Spark Core Affects Versions: 1.6.2 Reporter: Mikael Ståldal Spark registers some shutdown hooks, and they log messages during shutdown: https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/util/ShutdownHookManager.scala#L58 Since the {{Logging}} trait creates SLF4J loggers lazily: https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/internal/Logging.scala#L47 a SLF4J logger is created during the execution of the shutdown hook. This does not work when Log4j 2.x is used as SLF4J implementation: https://issues.apache.org/jira/browse/LOG4J2-1222 Even though Log4j 2.6 handles this more gracefully than before, it still does emit a warning and will not be able to process the log message properly. Proposed solution: make sure to eagerly create the SLF4J logger to be used in shutdown hooks when registering the hook. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org