You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "L. C. Hsieh (Jira)" <ji...@apache.org> on 2021/12/27 19:16:00 UTC
[jira] [Resolved] (SPARK-37746) log4j2-defaults.properties is not working since log4j 2 is always initialized by default
[ https://issues.apache.org/jira/browse/SPARK-37746?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
L. C. Hsieh resolved SPARK-37746.
---------------------------------
Fix Version/s: 3.3.0
Resolution: Fixed
Issue resolved by pull request 35026
[https://github.com/apache/spark/pull/35026]
> log4j2-defaults.properties is not working since log4j 2 is always initialized by default
> ----------------------------------------------------------------------------------------
>
> Key: SPARK-37746
> URL: https://issues.apache.org/jira/browse/SPARK-37746
> Project: Spark
> Issue Type: Bug
> Components: Spark Core
> Affects Versions: 3.3.0
> Reporter: Chia-Ping Tsai
> Assignee: Chia-Ping Tsai
> Priority: Minor
> Fix For: 3.3.0
>
>
> the code used to check initialization is shown below.
> val log4j2Initialized = !LogManager.getRootLogger
> .asInstanceOf[org.apache.logging.log4j.core.Logger].getAppenders.isEmpty
> That works for log4j. However, log4j2 provides a default configuration so there is always a appender (ConsoleAppender) with error level.
>
> reference from [https://logging.apache.org/log4j/2.x/manual/configuration.html#AutomaticConfiguration]
> Log4j will provide a default configuration if it cannot locate a configuration file. The default configuration, provided in the DefaultConfiguration class, will set up:
> * A [ConsoleAppender|https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/appender/ConsoleAppender.html] attached to the root logger.
> * A [PatternLayout|https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/layout/PatternLayout.html] set to the pattern "%d\{HH:mm:ss.SSS} [%t] %-5level %logger\{36} - %msg%n" attached to the ConsoleAppender
> Note that by default Log4j assigns the root logger to Level.ERROR.
>
>
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org