use a for loop to write out logs