ppkarwasz commented on issue #4697:
URL: https://github.com/apache/eventmesh/issues/4697#issuecomment-1872586687

   @Pil0tXia,
   
   In the next release of 
[`rewrite-logging-frameworks`](https://github.com/openrewrite/rewrite-logging-frameworks)
 there will be a recipe to automatically convert from SLF4J to Log4j API. They 
release every two weeks, so it will be available soon.
   
   Regarding passing a `Throwable` to Log4j API, the first argument that has no 
`{}` placeholder is interpreted as the throwable, so you can write:
   
   ```java
           try {
               ......
           } catch (Exception e) {
               log.debug("A time-consuming method: {}", () -> myMethod(), () -> 
e);
           }
   ```
   
   [all the arguments must be `Supplier`s or none of them]


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to