Show that if $|a|\le 1$, then $\int^{2\pi}_0 {\log|1-ae^{i\theta}|}\, d\theta =0$. 
Show that if $|a|\le1$, then $\int^{2\pi}_0 {\log|1-ae^{i\theta}|} \,d\theta =0$

This is from Stein's Complex Analysis.
I think that if $|a|<1$ then the function $\log|1-ae^{i\theta}|$ is holomorphic in the unit disk so the integral is clearly zero.

Am I making a mistake? What is the solution when $|a|=1$?

Help me please.
Thanks.
 A: Using Cauchy formula, you can show that 
$$\int_0^{2\pi} \log (1 - ae^{i\theta}) d\theta = 2\pi\log (1) = 0 \tag{1}$$
Similarly (going counter clockwise direction) you can show that 
$$\int_0^{2\pi} \log (1 - ae^{-i\theta}) d\theta = 2\pi\log (1) = 0 \tag{2}$$
Adding $(1)$ and $(2)$ you get the required result.
$$ \int_0^{2\pi} \log |1 - ae^{i\theta}|^2 d\theta = 0 $$
ADDED:: looks like I need strict inequality for above :S for case $a=1$, the integral you need to evaluate is 
$$\int_0^{2\pi} \log \sqrt{(1-\cos x)^2 + \sin^2x}dx = \int_0^{2\pi} \frac 1 2 \log (2- 2\cos(x) )dx  \\ 
= \pi \log 2 + \frac 1 2 \int_{0}^{2\pi} \log (1 - \cos(x))dx \tag{3}$$
Then integral converges because we know $\int_0^1 \log(x) dx $ converges and there is only two finite points where $\log(x)$ tends to singularity.
The integral on the right is $-\pi \log(2)$ making the whole expression zero.
$$\int_0^{2\pi} \log(1 - \cos(x)) dx = \int_0^{2\pi} \log(2 \sin^2 (x/2) )dx = 2 \pi \log (2) + 4 \int_0^{\pi} \log(\sin(y)) dy \tag{4}$$
The last integral is pretty famous, you can find it here and use it's value and show that the whole expression on $(3)$ is zero.
