How to print an exception stack trace using Log4J

All you have to do to print the stack trace of an exception using Java and Log4J (or the Apache Commons Logging project) is this:

log.error("Your description here", exception);


However, if you use

logger.error(exception);

it will only print the name of the Exception.

Comments

Popular posts from this blog

Fixed Windows warning: agent returned different signature type ssh-rsa (expected rsa-sha2-512)

How to install/renew SSL Certificate for Glassfish