Write status code to log if it is not a success code.