improve log rotation check