-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Spark] Fix delta-spark test log4j (#3700)
#### Which Delta project/connector is this regarding? - [X] Spark - [ ] Standalone - [ ] Flink - [ ] Kernel - [ ] Other (fill in here) ## Description #3146 added support for spark master structured logging, but broke the test logging for delta-spark against spark 3.5. This PR fixes that. The broken logging looked like this (https://github.com/delta-io/delta/actions/runs/10856009436/job/30129811815): ``` ERROR StatusConsoleListener Unable to locate plugin type for JsonTemplateLayout ERROR StatusConsoleListener Unable to locate plugin for JsonTemplateLayout ERROR StatusConsoleListener Could not create plugin of type class org.apache.logging.log4j.core.appender.FileAppender for element File: java.lang.NullPointerException java.lang.NullPointerException at org.apache.logging.log4j.core.config.plugins.visitors.PluginElementVisitor.findNamedNode(PluginElementVisitor.java:104) ``` ## How was this patch tested? GitHub CI tests. ## Does this PR introduce _any_ user-facing changes? No.
- Loading branch information
1 parent
4c3c70b
commit cddde68
Showing
3 changed files
with
69 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# | ||
# Copyright (2021) The Delta Lake Project Authors. | ||
# Licensed 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. | ||
# | ||
# | ||
# 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 file target/unit-tests.log | ||
rootLogger.level = info | ||
rootLogger.appenderRef.file.ref = ${sys:test.appender:-File} | ||
|
||
appender.file.type = File | ||
appender.file.name = File | ||
appender.file.fileName = target/unit-tests.log | ||
appender.file.append = true | ||
appender.file.layout.type = PatternLayout | ||
appender.file.layout.pattern = %d{yy/MM/dd HH:mm:ss.SSS} %t %p %c{1}: %m%n | ||
|
||
# Structured Logging Appender | ||
appender.structured.type = File | ||
appender.structured.name = structured | ||
appender.structured.fileName = target/structured.log | ||
appender.structured.layout.type = JsonTemplateLayout | ||
appender.structured.layout.eventTemplateUri = classpath:org/apache/spark/SparkLayout.json | ||
|
||
# Custom logger for testing structured logging with Spark master | ||
logger.structured_logging.name = org.apache.spark.sql.delta.logging.DeltaStructuredLoggingSuite | ||
logger.structured_logging.level = trace | ||
logger.structured_logging.appenderRefs = structured | ||
logger.structured_logging.appenderRef.structured.ref = structured | ||
|
||
# Tests that launch java subprocesses can set the "test.appender" system property to | ||
# "console" to avoid having the child process's logs overwrite the unit test's | ||
# log file. | ||
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.SSS} %t %p %c{1}: %m%n | ||
|
||
# Ignore messages below warning level from Jetty, because it's a bit verbose | ||
logger.jetty.name = org.sparkproject.jetty | ||
logger.jetty.level = warn |