I believe that I misunderstood the question in my first answer. What I think you want is a way to compute
$$
\int_0^\infty\frac{\log(x)}{1+x^2}\mathrm{d}x
$$
without using complex analysis.
With the substitution $x\mapsto\frac1x$, we get
$$
\int_0^\infty\frac{\log(x)}{1+x^2}\mathrm{d}x=-\int_0^\infty\frac{\log(x)}{1+x^2}\mathrm{d}x
$$
which says that
$$
\int_0^\infty\frac{\log(x)}{1+x^2}\mathrm{d}x=0
$$
A partial answer for the moment.
I think such an integral can be attacked with complex analytic techniques, but just after some manipulations. Integrating by parts we have:
$$ I = 2\int_{0}^{+\infty}\frac{t}{1+t^2}(-\log(1-e^{-t}))\,dt =2\sum_{n=1}^{+\infty}\frac{1}{n}\int_{0}^{+\infty}\frac{te^{-nt}}{1+t^2}\,dt\tag{1}$$
and since
$$ \frac{t}{1+t^2} = \int_{0}^{+\infty}e^{-tu}\cos u \,du, \tag{2} $$
it follows that:
$$\begin{eqnarray*} I &=& 2\sum_{n=1}^{+\infty}\frac{1}{n}\int_{0}^{+\infty}\frac{\cos u}{n+u}\,du=\color{red}{2\int_{0}^{+\infty} \frac{H_u}{u} \cos u\,du}\\&=&\color{blue}{2\int_{0}^{+\infty}\frac{dv}{v+1}\sum_{n=1}^{+\infty}\frac{\cos(nv)}{n}},\tag{3}\end{eqnarray*} $$
where $H_u=\gamma+\psi(u+1)$, $\gamma$ is the Euler constant and $\psi=\frac{\Gamma'}{\Gamma}$. In this form, the integral is convergent in virtue of the integral version of the Dirichlet's test: $\color{red}{\frac{H_u}{u}}$ is a smooth function on $\mathbb{R}^+$ decreasing to zero, or $\color{blue}{\sum_{n\geq 1}\frac{\cos(nv)}{n}}$ is a $2\pi$-periodic function, $-\log(2\sin(v/2))$, belonging to $L^1((0,2\pi))$ and having mean zero. We also have:
$$\begin{eqnarray*} I &=& 2\sum_{n=1}^{+\infty}\frac{1}{n}\int_{n}^{+\infty}\frac{\cos u\cos n+\sin u\sin n}{u}\,du\\&=&2\sum_{n=1}^{+\infty}\left(-\frac{\cos n}{n}\operatorname{Ci}(n)+\frac{\sin n}{n}\left(\frac{\pi}{2}-\operatorname{Si}(n)\right)\right)\\&=&\frac{\pi(\pi-1)}{2}-2\sum_{n=1}^{+\infty}\frac{\sin n\operatorname{Si}(n)+\cos n\operatorname{Ci}(n)}{n},\tag{4}\end{eqnarray*}$$
where $\operatorname{Si}(n)=\int_{0}^{n}\frac{\sin z}{z}\,dz$ and $\operatorname{Ci}(n)=-\int_{n}^{+\infty}\frac{\cos z}{z}\,dz$.
Addendum. Binet's second $\log\Gamma$-formula can be seen as a consequence of the Abel-Plana formula and it gives
$$\log\Gamma(z)=\left(z-\frac{1}{2}\right)\log(z)-z+\log\sqrt{2\pi}+\frac{1}{\pi}\int_{0}^{+\infty}\frac{\arctan\frac{t}{2\pi z}}{e^t-1}\,dz.\tag{5}$$
If we consider such identity at $z=\frac{1}{2\pi}$, then apply $\int_{0}^{\frac{1}{2\pi}}\left(\ldots\right)\,dz$ to both sides, we recover a closed form for the similar integral $\int_{0}^{+\infty}\frac{z\log(1+z^2)}{e^z-1}\,dz$. The evaluation at $z=\frac{i}{2\pi}$ leads to a closed form for $\int_{0}^{+\infty}\frac{\text{arctanh}(z)}{e^z-1}\,dz$.
Best Answer
A complex-analytic solution. Here is a combination of calculus and a basic complex analysis: Perform integration by parts to sanitize the integrand:
$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{\tan x} \, dx = \underbrace{ \left[ \vphantom{\int} x \log\sin x \right]_{0}^{\frac{\pi}{2}} }_{=0} - \int_{0}^{\frac{\pi}{2}} \log \sin x \, dx. $$
Also notice that, if $x \in (0,\frac{\pi}{2}]$ then $\log|\sin x| = -\log 2 + \operatorname{Re}\log(1 - e^{2ix})$. So
\begin{align*} \int_{0}^{\frac{\pi}{2}} \frac{x}{\tan x} \, dx &= - \frac{1}{2} \int_{0}^{\pi} \log |\sin x| \, dx \\ &= \frac{\pi}{2}\log 2 - \frac{1}{2} \operatorname{Re} \left( \int_{0}^{\pi} \log(1 - e^{2ix}) \, dx \right) \\ (z = e^{2ix}) \quad&= \frac{\pi}{2}\log 2 - \frac{1}{4} \operatorname{Re} \left( \oint_{|z|=1} \frac{\log(1 - z)}{iz} \, dz \right), \end{align*}
Since $z \mapsto \frac{\log(1 - z)}{iz}$ is holomorphic in the unit disc $\mathbb{D}$ and has only logarithmic singularity on the boundary $\partial \mathbb{D}$, we can still apply the Cauchy integral theorem to conclude that the integral vanishes. Therefore we have
$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{\tan x} \, dx = \frac{\pi}{2}\log 2. $$
Alternative complex-analytic solution. Use the substitution $x = \arctan u$ to write
$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{\tan x} \, dx = \frac{1}{2}\int_{-\infty}^{\infty} \frac{\arctan u}{u(u^2+1)} \, du. $$
This hints us that we may use some contour integration technique, but we need to resolve the branch cut of $\arctan$. Here we give one such trick. Notice that
$$ \frac{\arctan u}{u} = \int_{0}^{1} \frac{dt}{1+u^2 t^2}. $$
Plugging this back and interchanging the order of integration, we get
$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{\tan x} \, dx = \frac{1}{2}\int_{0}^{1} \left( \int_{-\infty}^{\infty} \frac{du}{(u^2 t^2+1)(u^2+1)} \right) \, dt. $$
Now we can perform contour integration to obtain that
\begin{align*} \int_{-\infty}^{\infty} \frac{du}{(u^2 t^2+1)(u^2+1)} &= 2\pi i \left( \underset{u = i}{\mathrm{Res}} \, \frac{1}{(u^2 t^2+1)(u^2+1)} + \underset{u = i/t}{\mathrm{Res}} \, \frac{1}{(u^2 t^2+1)(u^2+1)} \right) \\ &= \frac{\pi}{t+1}. \end{align*}
So we have
$$ \int_{0}^{\frac{\pi}{2}} \frac{x}{\tan x} \, dx = \frac{1}{2}\int_{0}^{1} \frac{\pi}{t+1} \, dt = \frac{\pi}{2} \log 2. $$