We have the function
$f(x)=\log _{x} \cos x$
$f(x)$ is defined for $\cos x>0$,
$x >0, x \neq 1$
$\because \cos x >0$
$\Rightarrow -\frac{\pi}{2} < x < \frac{\pi}{2}$
Also, $x > 0, x \neq 1$
$\therefore $ Domain of $f$ is $\left(0, \frac{\pi}{2}\right)-\{1\}$.