5. Given two propositions:

Proposition $p$ : The function $f(x)=\log _{a} x(x>0)$ is monotonically increasing;
Proposition $q$ : The function $g(x)=x^{2}+a x+1>0(x \in \mathbf{R})$.
If $p \vee q$ is a true proposition, and $p \wedge q$ is a false proposition, then the range of real number $a$ is
5. $(-2,1] \cup[2,+\infty)$.

It is easy to see that proposition $p$ holds if and only if $a>1$; proposition $q$ holds if and only if $-2<a<2$.
If $p \vee q$ is true, and $p \wedge q$ is false, then $a \in(-2,1] \cup[2,+\infty)$.