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