Skip to content

[fix][io] fix exception is not printed in error log#20847

Closed
zzzz465 wants to merge 1 commit intoapache:masterfrom
zzzz465:master
Closed

[fix][io] fix exception is not printed in error log#20847
zzzz465 wants to merge 1 commit intoapache:masterfrom
zzzz465:master

Conversation

@zzzz465
Copy link

@zzzz465 zzzz465 commented Jul 21, 2023

Motivation

there's missing {} and the inner exception is not printed

Modifications

add missing {} (fix typo)

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 21, 2023
@zzzz465 zzzz465 changed the title [fix][io] Add missing exception log [fix][io] fix exception is not printed in error log Jul 21, 2023
@BewareMyPower
Copy link
Contributor

I think it's not missed. The SLF4J logger supports adding an exception argument at the tail.

You can try the following code directly:

@Slf4j
public class Main {

    public static void main(String[] args) {
        final var e = new RuntimeException("error");
        log.info("exception: ", e);
    }
}

and you will see the output:

[2023-07-21 13:20:37,967] mainid INFO exception:  (org.example.Main)
java.lang.RuntimeException: error
	at org.example.Main.main(Main.java:9)

@zzzz465
Copy link
Author

zzzz465 commented Jul 21, 2023

thanks for the reply. I'll close this issue

@zzzz465 zzzz465 closed this Jul 21, 2023
@zzzz465
Copy link
Author

zzzz465 commented Jul 21, 2023

by the way, if the bulk request doesn't show the detailed / root cause of the exception, how is the user supposed to debug the error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants