I am using log4j with tomcat. When I log exceptions in my JSPs, servlets:
private Logger _log = Logger.getLogger(this.getClass());
...
try{...} catch (Except
There are two overloaded methods for error method.
logger.error(ex);logger.error("some oops string ", ex);if you use 1st method , which will only print the name of the Exception.
if you use 2nd method, some message along with exception which will print complete stack trace similar to e.printStackTrace() method.