Here’s my continuation to your last step, $$\int_0^{\frac{\pi}{2}} \frac{1}{a+b\sin x}\,dx=\frac{1}{\sqrt{b^2-a^2}}\left[{\ln\left(\frac{\left|\sqrt{b^{2} - a^{2}} - b - a\right|}{\left|\sqrt{b^{2} - a^{2}} + b + a\right|}\right)} - {\ln\left(\frac{\left|2 \sqrt{b^{2} - a^{2}} - 2b\right|}{\left|2 \sqrt{b^{2} - a^{2}} + 2b\right|}\right)}\right]$$
In your first integral, set $b=1$
$$I_1=\int_0^{\frac{\pi}{2}} \frac{1}{a+\sin x}\,dx=\frac{1}{\sqrt{1-a^2}}\left[{\ln\left(\frac{\left|\sqrt{1 - a^{2}} - (1+a)\right|}{\left|\sqrt{1 - a^{2}} + (1 + a)\right|}\right)} - {\ln\left(\frac{\left| \sqrt{1 - a^{2}} - 1\right|}{\left| \sqrt{1 - a^{2}} + 1\right|}\right)}\right]$$
In your second integral, set $b=-1$
$$I_2=\int_0^{\frac{\pi}{2}} \frac{1}{a-\sin x}\,dx=\frac{1}{\sqrt{1-a^2}}\left[{\ln\left(\frac{\left|\sqrt{1 - a^{2}} + 1 - a\right|}{\left|\sqrt{1 - a^{2}}+a-1\right|}\right)} - {\ln\left(\frac{\left| \sqrt{1- a^{2}} + 1\right|}{\left| \sqrt{1 - a^{2}} - 1\right|}\right)}\right]$$
$$\frac{\partial I(a)}{\partial a}=I_1+I_2$$
(I have not given proof to above generalized integral as it’s pretty popular and doable using the half angle tangent substitution and some partial fractions)
But i think this is too messy to solve, if you are interested to carry on, refer here
Anyways, I found a nice closed form to share, i will leave it for reference;
$$\boxed{\int_0^{\pi/2}\frac{1}{1+a\sin x }\, dx=\frac{2}{\sqrt{1-a^2}}\left(\tan^{-1}\left(\sqrt{\frac{1+a}{1-a}}\right) - \tan^{-1}\left(\frac{a}{\sqrt{1-a^2}}\right)\right)}$$
Here's the easier alternative;
Consider the integral from here
Set $a^2=A$ and $b^2=A-1$
We get, $$J(a)=\int_0^{\pi/2}\log(A-\sin^2(x))dx=\pi\ln \left(\frac{\sqrt{A}+\sqrt{A-1}}{2}\right)$$
So for $a>1$, $$\boxed{I(a)=\int_0^{\pi/2}\ln(a^2-\sin^2x)\,\mathrm dx=\pi\ln \left(\frac{{a}+\sqrt{a^2-1}}{2}\right)}$$