Skip to content
Closed
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
Prev Previous commit
Next Next commit
revert docs changes
  • Loading branch information
pan3793 committed Jun 13, 2025
commit 28222ec6b39bc901a837aaa5808569ff5fce4a2b
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ import java.util.{Collections, Map => JMap}

import org.apache.spark.SparkContext
import org.apache.spark.api.plugin.{DriverPlugin, ExecutorPlugin, PluginContext, SparkPlugin}
import org.apache.spark.internal.{Logging, MDC, SparkLoggerFactory}
import org.apache.spark.internal.LogKeys._
import org.apache.spark.internal.{Logging, SparkLoggerFactory}
import org.apache.spark.internal.config._
import org.apache.spark.internal.config.UI.UI_SHOW_CONSOLE_PROGRESS

/**
* A built-in plugin to allow redirecting stdout/stderr to logging system (SLF4J).
Expand All @@ -51,12 +49,6 @@ class DriverRedirectConsolePlugin extends DriverPlugin with Logging {
override def init(sc: SparkContext, ctx: PluginContext): JMap[String, String] = {
if (sc.conf.get(DRIVER_REDIRECT_CONSOLE_TO_LOG_ENABLED)) {
logInfo("Redirect driver's stdout/stderr to logging system")
if (sc.conf.get(UI_SHOW_CONSOLE_PROGRESS)) {
logWarning(log"Redirect driver's stderr to logging system may affect " +
log"console progress bar, consider disabling either " +
log"${MDC(CONFIG, DRIVER_REDIRECT_CONSOLE_TO_LOG_ENABLED.key)} or " +
log"${MDC(CONFIG2, UI_SHOW_CONSOLE_PROGRESS.key)}.")
}
RedirectConsolePlugin.redirectConsoleToLog()
}
Collections.emptyMap
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2843,8 +2843,7 @@ package object config {
ConfigBuilder("spark.driver.log.redirectConsole.enabled")
Copy link
Member

Choose a reason for hiding this comment

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

I mean, we can still configure separately for stderr/stdout if we have a config intaking a subset of {stderr, stdout}

Copy link
Member Author

Choose a reason for hiding this comment

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

I see, refactored the config to accept a list of console output kinds
spark.driver.log.redirectConsoleOutputs

.doc("Whether to redirect the driver's stdout/stderr to logging system. " +
s"It only takes affect when `${PLUGINS.key}` is configured with " +
"`org.apache.spark.deploy.RedirectConsolePlugin`. Note, enabling this " +
"feature may affect the shell console progress bar.")
"`org.apache.spark.deploy.RedirectConsolePlugin`.")
.version("4.1.0")
.booleanConf
.createWithDefault(true)
Expand Down