Let $ \displaystyle I(a) = \int_{0}^{\infty} \frac{x^{a}}{\cosh^{2} x} \ dx$.
Then if $\text{Re} (a) >0$,
$$ \begin{align} I(a) &= 4 \int_{0}^{\infty} \frac{x^{a}}{(e^{x}+e^{-x})^{2}} \ dx \\ &= 4 \int_{0}^{\infty}x^{a} \frac{e^{-2x}}{(1+e^{-2x})^{2}} \ dx \\ &=4\int_{0}^{\infty} x^{a} \sum_{n=1}^{\infty} (-1)^{n-1} n e^{-2nx} \ dx \\ &=4 \sum_{n=1}^{\infty} (-1)^{n-1}n \int_{0}^{\infty} x^{a} e^{-2nx} \ dx \\ &= 4 \sum_{n=1}^{\infty} (-1)^{n-1} n \frac{\Gamma(a+1)}{(2n)^{a+1}} \\ &= \frac{2 \Gamma(a+1)}{2^{a}}\sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^{a}} \\ &= \frac{2 \Gamma(a+1) \eta(a)}{2^{a}} \end{align}$$
where $\eta(a)$ is the Dirichlet eta function.
But by analytic continuation, the above formula is valid if $\text{Re}(a) >- 1$.
Then differentiating under the integral sign we get
$$ \begin{align} I'(a) &= \int_{0}^{\infty} \frac{x^{a} \log(x)}{\cosh^{2} x} \ dx \\ &= 2 \ \frac{[\Gamma'(a+1) \eta(a) + \Gamma(a+1) \eta'(a)]2^{a}- \Gamma(a+1) \eta(a) \log (2) 2^{a}}{2^{{2a}}} \ , \end{align}$$
which means
$$ \int_{0}^{\infty}\frac{\log x}{\cosh^{2}x} \ dx = I'(0) = 2 \Big( \Gamma'(1) \eta(0)+\eta'(0) - \eta(0) \log(2) \Big) .$$
The eta values can be determined using the relation
$$\eta(s) = (1-2^{1-s})\zeta(s) $$
and the known Riemann zeta values $$\zeta(0) = -\frac{1}{2} $$ and $$ \zeta'(0) = - \frac{1}{2} \log (2 \pi) . $$
Therefore,
$$ \begin{align} \int_{0}^{\infty}\frac{\log x}{\cosh^{2}x} \ dx &= 2 \left[-\gamma \left(\frac{1}{2}\right)+ \frac{1}{2} \log \left(\frac{\pi}{2}\right) -\frac{1}{2}\log(2) \right] \\ &= \log \left( \frac{\pi}{4}\right) - \gamma . \end{align}$$