StackTrace gives class, method, line number in source file.
Is there a way to get the time stamp at which the method executed as well?
I don't thnik so since the API doesn't give you access to a timestamp. Neither the Exception nor the StatckTraceElement API.
You can use logging (e.g. wtih log4j) and log the exception. A log record can print out the timestamp of the log record. Of cource this is the timestamp when the record was logged and not when the exception ocurred, but if you log immediatly after an exception it should not make a big difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With