How would I go about evaluating this integral? $$\int_0^{\infty}\frac{\ln(x^2+1)}{x^2+1}dx.$$ What I've tried so far: I tried a semicircular integral in the positive imaginary part of the complex plane, excluding the negative real axis, but had trouble calculating the residue at $z=i$ (perhaps there is a way of doing this that I don't know of). After that didn't work, I tried a rectangular box integral from $\epsilon$ to $R$, from $R$ to $R+i/2$, from $R+i/2$ to $-S+i/2$, from $-S+i/2$ to $-S+i\epsilon$, from $-S+i\epsilon$ to $-\epsilon+i\epsilon$ and finally a semicircle around the origin, radius $\epsilon$.
Any help would be appreciated.

Hints As RandomVariable suggested, use $\log(x^2+1)=\log(x+i)+\log(x-i)$, choosing the branches of the logarithm carefully. It's generally best to isolate unpleasant singular things.
Then write $$\int_0^\infty=\frac{1}{2}\int_{-\infty}^{\infty}$$ and make use of the above splitting to integrate the two parts on different contours, each time avoiding enclosing the singularity of the logarithm. The part on the semicircle vanishes.
Answer The UHP pole gives $\log(i+i)/2i\times2\pi i$. The LHP pole gives $\log(-i-i)/(-2i)\times-2\pi i$. Summing and halving gives the answer $$\frac{\pi}{2}\left(\log(2i)+\log(-2i)\right)$$ so all that remains is choosing the right logarithm. This is easy enough, actually, and the answer is what you expect: $$\pi\ln 2$$