Fourier series of $\log(a +b\cos(x))$?

Let's consider $$ f(x) = \log (1+q^2+2q\cos x) = \log |1+qe^{ix}|^2 , $$ which differs from your function only by the additive constant $2\log a_1$ if we take $q=a_0/a_1$. Since $|q|<1$, we can use the Taylor series of $\log(1+z)$ to write $$ \begin{align} f(x) = 2\,\textrm{Re}\; \log (1+qe^{ix}) = 2\,\textrm{Re}\sum_{n\ge 1} (-1)^{n-1}\frac{q^n}{n} e^{inx} \\ = 2\sum_{n\ge 1} (-1)^{n-1}\frac{q^n}{n} \cos nx . \end{align} $$


To apply the solution proposed by @ChristianRemling to the more general case stated in the title you need to do the following:

The formula implies $a > 0$ and $|b| < a$. To solve the problem, we reformulate the formula as: $$ \begin{align} r|1 + qe^{ix}|^2 &= r(1 + qe^{ix})(1 + qe^{-ix}) \\ &= r(1 + 2q\cos x + q^2) \\ & = a + b\cos x \\ \end{align} $$

This requires to solve the following system: $$ \begin{align} a &= r(1 + q^2) \\ b &= 2rq \end{align} $$

From the two possible solutions we take the one where $|q|<1$ which is mandatory for the Taylor expansion. $$ \begin{align} q = \frac{a - \sqrt{a^{2} - b^{2}}}{b} \\ r = \frac{a + \sqrt{a^{2} - b^{2}}}{2} \end{align} $$

Finally, Taylor series expansion solve the problem: $$ \begin{align} \log (a + b\cos x) &= \log r + 2\log | 1 + qe^{ix} | \\ &= \log r + 2 \sum {(-1)}^{n-1} \frac{q^n}{n} e^{inx} \\ &= \log r + 2 \sum {(-1)}^{n-1} \frac{q^n}{n} \cos nx \end{align} $$