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-48592][INFRA] Add structured logging style script and GitHub workflow #47239

Closed
wants to merge 32 commits into from

Conversation

asl3
Copy link
Contributor

@asl3 asl3 commented Jul 5, 2024

What changes were proposed in this pull request?

This PR checks for Scala logging messages using logInfo, logWarning, logError and containing variables without MDC wrapper

Example error output:

[error] spark/mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala:225:4
[error] Logging message should use Structured Logging Framework style, such as log"...${MDC(TASK_ID, taskId)..."
                Refer to the guidelines in the file `internal/Logging.scala`.

Why are the changes needed?

This makes development and PR review of the structured logging migration easier.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Manual test, verified it will throw errors on invalid logging messages.

Was this patch authored or co-authored using generative AI tooling?

No

@asl3 asl3 requested a review from gengliangwang July 8, 2024 23:21
Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

Seems fine from a cursory look

@gengliangwang
Copy link
Member

Thanks, merging to master

jingz-db pushed a commit to jingz-db/spark that referenced this pull request Jul 22, 2024
…orkflow

### What changes were proposed in this pull request?
This PR checks for Scala logging messages using logInfo, logWarning, logError and containing variables without MDC wrapper

Example error output:
```
[error] spark/mllib/src/main/scala/org/apache/spark/mllib/clustering/StreamingKMeans.scala:225:4
[error] Logging message should use Structured Logging Framework style, such as log"...${MDC(TASK_ID, taskId)..."
                Refer to the guidelines in the file `internal/Logging.scala`.
```

### Why are the changes needed?
This makes development and PR review of the structured logging migration easier.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Manual test, verified it will throw errors on invalid logging messages.

### Was this patch authored or co-authored using generative AI tooling?
No

Closes apache#47239 from asl3/structuredlogstylescript.

Authored-by: Amanda Liu <amanda.liu@databricks.com>
Signed-off-by: Gengliang Wang <gengliang@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants