Hi need to stack trace of java exception to log file .how it can done. simple messages i am able to send in log file but how to send complete stack trace of exception
exception.printStackTrace() should print the stacktrace to the System.out log. Is this not adequate? exception.getClass() exception.getMessage() and exception.printStackTrace() should do it.
I have a feeling you were looking for something a little more in depth. Let me know.
Hi need to stack trace of java exception to log file
Assuming you are using log4j, log4j has overloaded methods to which you can pass the entire exception object and it will print the exception stacktrace in the appropriate log file. Something like: