only attempt to log retries if a logger was provided