Retain only the last n logs