move the logger out of tag-for loop