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-48145][CORE] Remove logDebug and logTrace with MDC in JAVA structured logging framework #46405

Closed
wants to merge 1 commit into from

Conversation

gengliangwang
Copy link
Member

What changes were proposed in this pull request?

Since we are targeting on migration INFO/WARN/ERROR level logs to structure logging, this PR removes the logDebug and logTrace methods from the JAVA structured logging framework.

Why are the changes needed?

In the log migration PR #46390, there are unnecessary changes such as updating

logger.debug("Task {} need to spill {} for {}", taskAttemptId,
            Utils.bytesToString(required - got), requestingConsumer);

to

LOGGER.debug("Task {} need to spill {} for {}", String.valueOf(taskAttemptId),
            Utils.bytesToString(required - got), requestingConsumer.toString());

With this PR, we can avoid such changes during log migrations.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing UT.

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

No

@gengliangwang
Copy link
Member Author

cc @panbingkun as well.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

Is this consistent with SPIP, @gengliangwang ?

@dongjoon-hyun
Copy link
Member

#46390 is not merged yet, isn't it?

In the log migration PR #46390, there are unnecessary changes such as updating

@gengliangwang
Copy link
Member Author

Is this consistent with SPIP, @gengliangwang ?

Yes, the SPIP only suggests the logInfo/logWarn/logError APIs. LogDebug/LogTrace is optional. Since #46390 is not migrating the debug/trace level logs, I suggest merging this one to reduce unnecessary changes in it.

@gengliangwang
Copy link
Member Author

In Scala side, the logDebug/logTrace APIs was introduced for debugging cache purposes: #45990

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM. Thank you!

@dongjoon-hyun
Copy link
Member

cc @cloud-fan as a release manager for Apache Spark 4.0.0-preview

@dongjoon-hyun
Copy link
Member

Merged to master for Apache Spark 4.0.0-preview.

@dongjoon-hyun
Copy link
Member

Thank you, @gengliangwang .

@panbingkun
Copy link
Contributor

cc @panbingkun as well.

Got it.
Thanks.

JacobZheng0927 pushed a commit to JacobZheng0927/spark that referenced this pull request May 11, 2024
…uctured logging framework

### What changes were proposed in this pull request?

Since we are targeting on migration INFO/WARN/ERROR level logs to structure logging, this PR removes the logDebug and logTrace methods from the JAVA structured logging framework.

### Why are the changes needed?

In the log migration PR apache#46390, there are unnecessary changes such as updating
```
logger.debug("Task {} need to spill {} for {}", taskAttemptId,
            Utils.bytesToString(required - got), requestingConsumer);
```
to
```
LOGGER.debug("Task {} need to spill {} for {}", String.valueOf(taskAttemptId),
            Utils.bytesToString(required - got), requestingConsumer.toString());
```

With this PR, we can avoid such changes during log migrations.
### Does this PR introduce _any_ user-facing change?

No
### How was this patch tested?

Existing UT.
### Was this patch authored or co-authored using generative AI tooling?

No

Closes apache#46405 from gengliangwang/updateJavaLog.

Authored-by: Gengliang Wang <gengliang@apache.org>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants