Added logging capability

Allow logging of exceptions and/or successful responses.