While Szeto answer offer a very neat solution, I was wondering why OP process lead to a wrong answer. Well turns out it's not!
We want to evaluate
$$J = \int_{0}^\infty\frac{\log^4(x)}{1+x^2}dx$$
so we introduce the function $f(z) = \frac{\log^4(z)}{1+z^2}$ for $\arg z \in \left(-\frac{\pi}{2}, \frac{3\pi}{2}\right)$ and the integration contour below
$\hskip1.5in$
le $C_1$ the entire contour, using Residue Theorem we got
$$\begin{align*}
\oint_{C_1}f(z)dz &= 2\pi i \text{Res}_f(i)\\
&= 2\pi i \frac{(\ln |i| + i )^4}{2i} = \frac{\pi^5}{16}
\end{align*}$$
it is also true that
$$\oint_{C_1}f(z)dz = \left(\int_{\varepsilon}^{R}+\int_{-R}^{-\varepsilon}+ \int_\gamma + \int_\Gamma\right)f$$ where as OP correctly stated for $\varepsilon \to 0, R\to +\infty$, integrals along $\gamma,\Gamma$ tend to zero. We have
$$\begin{align*}\frac{\pi^5}{16} &= J + \int_{-\infty}^{0} \frac{(\ln|z|+i\pi)^4}{1+z^2}dz \quad (z=-t)\\
&= J +\int_{0}^{+\infty} \frac{(\ln|t|+i\pi)^4}{1+t^2}dt\\
&= J +\int_{0}^{+\infty} \frac{\sum_{n=0}^4\binom{4}{n}\ln^n(t)(i\pi)^{4-n}}{1+t^2}dt
\end{align*}$$
taking the real part of the latter
$$2J = \frac{\pi^5}{16} + \underbrace{\int_{0}^{+\infty} \frac{6\pi^2\ln^2(t) - \pi^4}{1+t^2}dt}_{I_1}$$
we are now interested in evaluating $I_1$. It is composed by two parts
$$\begin{align*}I_1 = \int_{0}^{+\infty} \frac{6\pi^2\ln^2(t)}{1+t^2}dt- \pi^4\int_{0}^{+\infty} \frac{1}{1+t^2}dt &= 6\pi^2I_2 - \pi^4 \left [\arctan(t) \right]_0^\infty\\
&=6\pi^2I_2 -\frac{\pi^5}{2}\label{eq}\tag{$*$}
\end{align*}$$
for $I_2$ we use the previously mentioned contour and we introduce $g(z) = \frac{\log^2(z)}{1+z^2}$ for $\arg z \in \left(-\frac{\pi}{2}, \frac{3\pi}{2}\right)$.
As before integrals on semicircle vanish for $\varepsilon \to 0, R\to +\infty$ and we end up with
$$\oint_{C_1}g(z)dz = -\frac{\pi^3}{4} = 2I_2 - \frac{\pi^3}{2}+2i\pi \int_{0}^{+\infty}\frac{\log t}{1+t^2}dt$$
taking real parts we can evaluate $I_2$ as
$$I_2 = -\frac{\pi^3}{8}+\frac{\pi^3}{4} = \frac{\pi^3}{8}$$
recalling $\eqref{eq}$ we conclude our calculation
$$ I_1= 6\pi^2I_2-\frac{\pi^5}{2} = \frac{\pi^5}{4}$$
And we finally came to the right answer
$$\boxed{\int_{0}^\infty\frac{\log^4(x)}{1+x^2}dx = \frac{5\pi^5}{32}}$$