Skip to content

Commit

Permalink
[SPARK-6305][BUILD][FOLLOWUP] Remove log4j1 properties files
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

This patch removes log4j1 properties files, rewrites log4j.properties.template and mention the migration in the migration guide.

### Why are the changes needed?

After migrating from log4j1 to log4j2, we can remove log4j1 properties files.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Existing tests.

Closes apache#34941 from viirya/remove_log4j_properties.

Authored-by: Liang-Chi Hsieh <[email protected]>
Signed-off-by: Liang-Chi Hsieh <[email protected]>
  • Loading branch information
viirya committed Dec 20, 2021
1 parent 13fd9ee commit 34fb801
Show file tree
Hide file tree
Showing 29 changed files with 67 additions and 936 deletions.
27 changes: 0 additions & 27 deletions common/kvstore/src/test/resources/log4j.properties

This file was deleted.

27 changes: 0 additions & 27 deletions common/network-common/src/test/resources/log4j.properties

This file was deleted.

24 changes: 0 additions & 24 deletions common/network-shuffle/src/test/resources/log4j.properties

This file was deleted.

48 changes: 0 additions & 48 deletions conf/log4j.properties.template

This file was deleted.

63 changes: 63 additions & 0 deletions conf/log4j2.properties.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Set everything to be logged to the console
rootLogger.level = info
rootLogger.appenderRef.file.ref = console

appender.console.type = Console
appender.console.name = console
appender.console.target = SYSTEM_ERR
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n

# Set the default spark-shell/spark-sql log level to WARN. When running the
# spark-shell/spark-sql, the log level for these classes is used to overwrite
# the root logger's log level, so that the user can have different defaults
# for the shell and regular Spark apps.
logger.repl.name = org.apache.spark.repl.Main
logger.repl.level = warn

logger.thriftserver.name = org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver
logger.thriftserver.level = warn

# Settings to quiet third party logs that are too verbose
logger.jetty1.name = org.sparkproject.jetty
logger.jetty1.level = warn
logger.jetty2.name = org.sparkproject.jetty.util.component.AbstractLifeCycle
logger.jetty2.level = error
logger.replexprTyper.name = org.apache.spark.repl.SparkIMain$exprTyper
logger.replexprTyper.level = info
logger.replSparkILoopInterpreter.name = org.apache.spark.repl.SparkILoop$SparkILoopInterpreter
logger.replSparkILoopInterpreter.level = info
logger.parquet1.name = org.apache.parquet
logger.parquet1.level = error
logger.parquet2.name = parquet
logger.parquet2.level = error

# SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support
logger.RetryingHMSHandler.name = org.apache.hadoop.hive.metastore.RetryingHMSHandler
logger.RetryingHMSHandler.level = fatal
logger.FunctionRegistry.name = org.apache.hadoop.hive.ql.exec.FunctionRegistry
logger.FunctionRegistry.level = error

# For deploying Spark ThriftServer
# SPARK-34128: Suppress undesirable TTransportException warnings involved in THRIFT-4805
appender.console.filter.1.type = MarkerFilter
appender.console.filter.1.marker = Thrift error occurred during processing of message
appender.console.filter.1.onMatch = deny
appender.console.filter.1.onMismatch = neutral
36 changes: 0 additions & 36 deletions core/src/test/resources/log4j.properties

This file was deleted.

4 changes: 4 additions & 0 deletions docs/core-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ license: |
* Table of contents
{:toc}

## Upgrading from Core 3.2 to 3.3

- Since Spark 3.3, Spark migrates its log4j dependency from 1.x to 2.x because log4j 1.x has reached end of life and is no longer supported by the community. Vulnerabilities reported after August 2015 against log4j 1.x were not checked and will not be fixed. Users should rewrite original log4j properties files using log4j2 syntax (XML, JSON, YAML, or properties format). Spark rewrites the `conf/log4j.properties.template` which is included in Spark distribution, to `conf/log4j2.properties.template` with log4j2 properties format.

## Upgrading from Core 3.1 to 3.2

- Since Spark 3.2, `spark.scheduler.allocation.file` supports read remote file using hadoop filesystem which means if the path has no scheme Spark will respect hadoop configuration to read it. To restore the behavior before Spark 3.2, you can specify the local scheme for `spark.scheduler.allocation.file` e.g. `file:///path/to/file`.
Expand Down
28 changes: 0 additions & 28 deletions external/avro/src/test/resources/log4j.properties

This file was deleted.

This file was deleted.

30 changes: 0 additions & 30 deletions external/kafka-0-10-sql/src/test/resources/log4j.properties

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions external/kafka-0-10/src/test/resources/log4j.properties

This file was deleted.

Loading

0 comments on commit 34fb801

Please sign in to comment.