When working with CompletableFuture any potential errors from computing the value are exposed via the get() method throwing an ExecutionException. I can of course log this exception at the time of calling this method, but it would be misleading as this exception may have happened at a completely different time from the current.
In short, I would like information on when the ExecutionException occurred.
Is there any elegant solution to this ?
Try to wrap execution code into try-catch, which you passed to CompletableFuture.