This is a problem from Complex Analysis by Stein and Shakarchi.
We have to find the the value of $\int_0^{2\pi} \log|1-ae^{i \theta}| $ when $|a|<1$. So I tried to solve it in this manner.
I first made the substitution $e^{i\theta}=z$. Then the integral becomes $\int_\gamma \frac{\log|1-az|}{iz} $. Then we observe that $\int_0^{2\pi} \log|1-ae^{i \theta}| $ is the real part of the integral $\int_0^{2\pi} \log(1-ae^{i \theta}) $. So we will evaluate $\int_\gamma \frac{\log(1-az)}{iz} $. But this function has a removable singularity at $z=0$.So the integral of this function is zero since it is holomorphic. So its real part is also zero.
Is my reasoning right?If not can someone please point out what is wrong. Thanks
Your reasoning is correct. Instead of appealing to removability of a singularity, you could use Cauchy's integral formula to the same effect: if $f$ is holomorphic on the closed unit disk (meaning it's holomorphic in some larger open set), then $$f(0)=\frac{1}{2\pi i } \int_{|z|=1}\frac{f(z)}{z-0}\,dz = \frac{1}{2\pi } \int_{|z|=1}f(z)\,|dz| $$ Using $f(z)= \log(1-az)$ and taking real part of both sides yields the claim.
The Related sidebar contains a number of other questions about this integral.