I am using Log4j2, some versions of beta-10 or so.
It is easy to write a stack trace if there is an exception:
} catch (Exception ex) {
log.error("Doing stuff went wrong", ex);
}
Suppose there is no object Throwable- I realized that there is a problem and you want to register an error:
if (stuffIsWrong()) {
log.error("Stuff went wrong");
}
How can I tell Log4j2 for the stack trace log starting from the current method?
source
share