Why is the run time with a loop of this structure considered O(log n)
Assuming the model of computation is RAM(Random Access Machine). Which means the cost of addition, multiplication,division etc is constant. Now your program is 

int j = 0;
for (int i = 1; i &lt;= n; i *= 2) {
    j = j + n * 2;
}


Inside the loop, you are doing addition, multiplication, comparison etc which takes constant time. Let $k$ denotes the number of iterations of the loop. Let $c_i$ denotes the cost at $i$th iteration of loop.
The total cost is

$$ = c_1+c_2+\ldots + c_{k}$$
$$ = \sum_{ j =1 \text{ to } k}c_i$$

It is easy to see that above summation gives $\mathcal{O}(\log n)$.