You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "BewareMyPower (via GitHub)" <gi...@apache.org> on 2023/07/21 05:21:35 UTC

[GitHub] [pulsar] BewareMyPower commented on pull request #20847: [fix][io] fix exception is not printed in error log

BewareMyPower commented on PR #20847:
URL: https://github.com/apache/pulsar/pull/20847#issuecomment-1644997788

   I think it's not missed. The SLF4J logger supports adding an exception argument at the tail.
   
   You can try the following code directly:
   
   ```java
   @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)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org