error logging now includes stack trace. TODO: better formatting.

Add stacktrace for errors.