Handle IOError in logger