Added logging capability

Allow logging of successfully responses and also exceptions.