8. Let $f(x)=\cos \frac{x}{5}, a=f\left(\log _{0} \frac{1}{\pi}\right)$,
$$
b=f\left(\log _{\pi} \frac{1}{\mathrm{e}}\right), c=f\left(\log _{\frac{1}{4}} \frac{1}{\pi^{2}}\right) .
$$

Then the correct relationship among the following is ( ).
(A) $a>b>c$
(B) $b>c>a$
(C) $c>a>b$
(D) $b>a>c$
8. D.

The function $f(x)=\cos \frac{x}{5}$ is an even function, and $g(x)=\cos x$ is decreasing on $\left(0, \frac{\pi}{2}\right)$.
Moreover, $\log _{e} \frac{1}{\pi}=-\log _{a} \pi, \log _{x} \frac{1}{e}=-\frac{1}{\log _{e} \pi}$, $\log _{\frac{1}{4}} \frac{1}{\pi^{2}}=2 \log _{e} \pi$,
Therefore, $0a>c$.