Refactored logging and now log send failures properly.