Updated to handle log rotations