How do you write a full stack trace to the log?

Viewed 60377

I was catching an exception and trying to write the stack trace to the logs like this:

log.warn(e.getMessage());

But all it said was

null

So I changed it to

log.warn(e.toString());

And now it says only

java.lang.NullPointerException

How do I write the full stack trace to the log so I can see where this Exception is being generated in the app?

6 Answers
Related