rework for updated contour and logwrap, add close of logs