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-48074][Core] Improve the readability of JSON loggings #46322

Closed
wants to merge 4 commits into from

Conversation

gengliangwang
Copy link
Member

@gengliangwang gengliangwang commented May 1, 2024

What changes were proposed in this pull request?

Improve the readability of JSON loggings via:

  1. Use UTC in the timestamp so that the timestamp field value is more concise.
  2. Display the simple name of the logger instead of the full qualified name.
  3. Display the stack trace elements with class/method/file/line instead of stringifying everything into a long string.

Before changes:
image

After changes:
image

Why are the changes needed?

Improve the readability of Spark logs

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing UT and manually reviews

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

No

@gengliangwang
Copy link
Member Author

cc @panbingkun @dtenedor 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.

Sorry but I'm not sure this is better because I prefer level at the original position.

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 (Pending CIs).

Thank you. I removed the following from the PR title consistently.

  1. Move the order level field, so that users can read the messages right after the timestamps.

@dongjoon-hyun
Copy link
Member

Merged to master for Apache spark 4.0.0.

@panbingkun
Copy link
Contributor

+1, LGTM

JacobZheng0927 pushed a commit to JacobZheng0927/spark that referenced this pull request May 11, 2024
### What changes were proposed in this pull request?

Improve the readability of JSON loggings via:
1. Use UTC in the timestamp so that the timestamp field value is more concise.
2. Display the simple name of the logger instead of the full qualified name.
3. Display the stack trace elements with `class`/`method`/`file`/`line` instead of stringifying everything into a long string.

Before changes:
<img width="2129" alt="image" src="https://github.com/apache/spark/assets/1097932/a7458293-2f84-4699-bbc2-3183a078a543">

After changes:
<img width="2341" alt="image" src="https://github.com/apache/spark/assets/1097932/23742bc0-4e1e-491c-83c9-b6695f41e57e">

### Why are the changes needed?

Improve the readability of Spark logs
### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Existing UT and manually reviews

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

No

Closes apache#46322 from gengliangwang/improveLayout.

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