Ok, here I am. The goal is to compute the Fourier series of $g(x)=\log\sin x$ over $[0,\pi]$, or the Fourier series of $h(x)=\log\sin\frac{x}{2}$ over $[0,2\pi]$, or the Fourier series of $f(x)=\log\cos\frac{x}{2}$ over $[-\pi,\pi]$. Since $f(x)$ is an even function, we have to compute:
$$ a_n = \frac{1}{\pi}\int_{-\pi}^{+\pi}\cos(nx)\log\cos\frac{x}{2}\,dx = \frac{2}{\pi}\int_{0}^{\pi}\cos(nx)\log\cos\frac{x}{2}\,dx$$
for any $n\geq 1$ to be able to state:
$$ f(x) = \frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)\,dx + \sum_{n\geq 1}a_n\cos(nx)=\frac{a_0}{2}+\sum_{n\geq 1}a_n\cos(nx).$$
for any $x\in(-\pi,\pi)$. Integration by parts gives:
$$ a_n = \frac{2}{\pi}\left(\frac{1}{n}\left.\sin(nx)\log\cos\frac{x}{2}\right|_{0}^{\pi}+\frac{1}{2n}\int_{0}^{\pi}\sin(nx)\tan\frac{x}{2}\,dx\right)$$
or just:
$$ a_n = \frac{1}{\pi n}\int_{0}^{\pi}\frac{\sin(nx)\sin(x/2)}{\cos(x/2)}\,dx = \frac{2}{\pi n}\int_{0}^{\pi/2}\frac{\sin(2nx)\sin x}{\cos x}\,dx.$$
Since $\cos((2n+1)x)=2\cos x\cos(2nx)-\cos((2n-1)x)$, we have:
$$ a_n = \frac{1}{\pi n}\int_{0}^{\pi/2}\sum_{k=1}^{n}\cos((2k-1)x)\,dx =\frac{(-1)^{n+1}}{n}.$$
This gives:
$$\log\cos\frac{x}{2}=\frac{a_0}{2}+\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\cos(nx)$$
for any $x\in(-\pi,\pi)$. In order to find $a_0$, we can simply match $f(0)=0$ with the series on the right hand side. Since:
$$\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}=\int_{0}^{1}\frac{dx}{1+x}=\log 2,$$
we have:
$$\log\cos\frac{x}{2}=-\log 2+\sum_{n\geq 1}\frac{(-1)^{n+1}}{n}\cos(nx)\qquad\forall x\in(-\pi,\pi),\tag{1}$$
and by translating the variable:
$$\log\sin\frac{x}{2}=-\log 2-\sum_{n\geq 1}\frac{1}{n}\cos(nx)\qquad\forall x\in(0,2\pi),\tag{2}$$
$$\log\sin x = -\log 2-\sum_{n\geq 1}\frac{1}{n}\cos(2nx)\qquad\forall x\in(0,\pi),\tag{3}$$
as wanted.
A little addendum, since I think it is worth mentioning the following technique. Starting with a celebrated identity:
$$\prod_{k=1}^{n-1}\sin\frac{\pi k}{n}=\frac{2n}{2^n}$$
and noticing that $\log\sin x$ is a Riemann integrable function over $(0,\pi)$, we have:
$$\int_{0}^{\pi}\log\sin x\,dx = \lim_{n\to +\infty}\frac{\pi}{n}\sum_{k=1}^{n-1}\log\sin\frac{\pi k}{n}=\lim_{n\to +\infty}\frac{\pi}{n}\log\frac{2n}{2^n}=\color{red}{-\pi\log 2}.$$
Best Answer
Note first that we have in the complex fourier series also negaitve $n$, that is $$ f(x) = \sum_{n=-\infty}^\infty f_n \exp(inx) $$ Now, by Euler $\exp(inx) = \cos(nx) + i\sin(nx)$. Now $\cos$ is even and $\sin$ is odd, so we have for $n\in \mathbb N$: \begin{align*} f_n\exp(inx) + f_{-n}\exp(-inx) &= f_n\cos(nx) + f_{-n}\cos(-nx) + i\bigl(f_n\sin(nx) + f_{-n}\sin(-nx)\bigr)\\ &= (f_n + f_{-n})\cos(nx) + i(f_n - f_{-n})\sin(nx) \end{align*} So we have $$ f(x) = f_0 + \sum_{n=1}^\infty \bigl((f_n+f_{-n})\cos(nx) + i(f_n-f_{-n})\sin(nx)\bigr) $$ Equating coefficients yields \begin{align*} a_0 &= f_0\\ a_n &= f_n + f_{-n} \qquad n \ge 1\\ b_n &= i\bigl(f_n - f_{-n}\bigr) \end{align*}