Added ability to print stack trace to log