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-48623][CORE] Migrate FileAppender logs to structured logging #47394

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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 @@ -758,6 +758,7 @@ private[spark] object LogKeys {
case object STORAGE_LEVEL_REPLICATION extends LogKey
case object STORAGE_MEMORY_SIZE extends LogKey
case object STORE_ID extends LogKey
case object STRATEGY extends LogKey
case object STREAMING_CONTEXT extends LogKey
case object STREAMING_DATA_SOURCE_DESCRIPTION extends LogKey
case object STREAMING_DATA_SOURCE_NAME extends LogKey
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ package org.apache.spark.util.logging
import java.io.{File, FileOutputStream, InputStream, IOException}

import org.apache.spark.SparkConf
import org.apache.spark.internal.{config, Logging, MDC}
import org.apache.spark.internal.{config, Logging, LogKeys, MDC}
import org.apache.spark.internal.LogKeys._
import org.apache.spark.util.{IntParam, Utils}

Expand Down Expand Up @@ -177,8 +177,8 @@ private[spark] object FileAppender extends Logging {
inputStream, file, new SizeBasedRollingPolicy(bytes), conf, closeStreams = closeStreams)
case _ =>
logWarning(
log"Illegal size [${MDC(NUM_BYTES, rollingSizeBytes)}] " +
log"for rolling executor logs, rolling logs not enabled")
log"Illegal size [${MDC(LogKeys.NUM_BYTES, rollingSizeBytes)}] " +
log"for rolling executor logs, rolling logs not enabled")
new FileAppender(inputStream, file, closeStreams = closeStreams)
}
}
Expand All @@ -192,8 +192,8 @@ private[spark] object FileAppender extends Logging {
createSizeBasedAppender()
case _ =>
logWarning(
s"Illegal strategy [$rollingStrategy] for rolling executor logs, " +
s"rolling logs not enabled")
log"Illegal strategy [${MDC(LogKeys.STRATEGY, rollingStrategy)}] for " +
log"rolling executor logs, rolling logs not enabled")
new FileAppender(inputStream, file, closeStreams = closeStreams)
}
}
Expand Down