Getting stacktrace in logger Getting stacktrace in logger java java

Getting stacktrace in logger


You have to use the two argument form

log.error("my logging message", exception)

See http://www.devdaily.com/blog/post/java/how-print-exception-stack-trace-using-log4j-commons for more details.


Change your logging statement to:

log.error("Exception is: ", e);


It is actualy log4j that prevents the printing of the fulltime stacktrace. You should however set the exception as a second parameter for the error method.