You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Mikael Ståldal (JIRA)" <ji...@apache.org> on 2016/07/25 08:28:20 UTC
[jira] [Closed] (SPARK-16416) Logging in shutdown hook does not
work properly with Log4j 2.x
[ https://issues.apache.org/jira/browse/SPARK-16416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mikael Ståldal closed SPARK-16416.
----------------------------------
Latest master works fine.
> 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
> Assignee: Mikael Ståldal
> Priority: Minor
> Fix For: 2.1.0
>
>
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org