-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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-47583][CORE] SQL core: Migrate logError with variables to structured logging framework #45969
Conversation
cc @gengliangwang here is the structured logging migration for |
val plans = | ||
sideBySide(currentPhysicalPlan.treeString, newPhysicalPlan.treeString).mkString("\n") | ||
logOnLevel(log"Plan changed:\n" + | ||
log"${MDC(QUERY_PLAN, plans)}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val plans = | |
sideBySide(currentPhysicalPlan.treeString, newPhysicalPlan.treeString).mkString("\n") | |
logOnLevel(log"Plan changed:\n" + | |
log"${MDC(QUERY_PLAN, plans)}") | |
lazy val plans = | |
sideBySide(currentPhysicalPlan.treeString, newPhysicalPlan.treeString).mkString("\n") | |
logOnLevel(log"Plan changed:\n${MDC(QUERY_PLAN, plans)}") |
@transient private val logOnLevel: ( => MessageWithContext) => Unit = | ||
conf.adaptiveExecutionLogLevel match { | ||
case "TRACE" => | ||
def fn(log: => LogEntry): Unit = logTrace(log.message) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a logTrace
accepting MessageWithContext now.
Thanks, merging to master |
…ctured logging framework ### What changes were proposed in this pull request? Migrate logError with variables of the sql/core module to structured logging framework. This transforms the logError entries of the following API ``` def logError(msg: => String): Unit ``` to ``` def logError(entry: LogEntry): Unit ``` ### Why are the changes needed? To enhance Apache Spark's logging system by implementing structured logging. ### Does this PR introduce _any_ user-facing change? Yes, Spark core logs will contain additional MDC ### How was this patch tested? Compiler and scala style checks, as well as code review. ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#45969 from dtenedor/log-error-sql-core. Authored-by: Daniel Tenedorio <[email protected]> Signed-off-by: Gengliang Wang <[email protected]>
What changes were proposed in this pull request?
Migrate logError with variables of the sql/core module to structured logging framework. This transforms the logError entries of the following API
to
Why are the changes needed?
To enhance Apache Spark's logging system by implementing structured logging.
Does this PR introduce any user-facing change?
Yes, Spark core logs will contain additional MDC
How was this patch tested?
Compiler and scala style checks, as well as code review.
Was this patch authored or co-authored using generative AI tooling?
No