Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-50433][DOCS][TEST] Fix confguring log4j2 guide docs for Spark on YARN and UT #48981

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ object IntegrationTestUtils {

// Redirect server log into console
"--conf",
s"spark.driver.extraJavaOptions=-Dlog4j.configuration=$log4j2")
s"spark.driver.extraJavaOptions=-Dlog4j.configurationFile=$log4j2")
Copy link
Member Author

@pan3793 pan3793 Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LOG4J2 should only respect log4j.configurationFile, I'm not sure how the previous code worked. cc @zhenlineo

} else Seq.empty
}

Expand Down
6 changes: 3 additions & 3 deletions docs/running-on-yarn.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,13 @@ settings and a restart of all node managers. Thus, this is not applicable to hos

To use a custom log4j configuration for the application master or executors, here are the options:
pan3793 marked this conversation as resolved.
Show resolved Hide resolved

- upload a custom `log4j.properties` using `spark-submit`, by adding it to the `--files` list of files
- upload a custom `log4j2.properties` using `spark-submit`, by adding it to the `--files` list of files
to be uploaded with the application.
- add `-Dlog4j.configuration=<location of configuration file>` to `spark.driver.extraJavaOptions`
- add `-Dlog4j.configurationFile=<location of configuration file>` to `spark.driver.extraJavaOptions`
(for the driver) or `spark.executor.extraJavaOptions` (for executors). Note that if using a file,
the `file:` protocol should be explicitly provided, and the file needs to exist locally on all
the nodes.
- update the `$SPARK_CONF_DIR/log4j.properties` file and it will be automatically uploaded along
- update the `$SPARK_CONF_DIR/log4j2.properties` file and it will be automatically uploaded along
with the other configurations. Note that other 2 options has higher priority than this option if
multiple options are specified.

Expand Down