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 $\qquad$ .
Proposition $p$ is true $\Leftrightarrow a>1$; Proposition $q$ is true $\Leftrightarrow \Delta=a^{2}-4<0 \Leftrightarrow-2<a<2$. Then $p \vee q$ is true $\Rightarrow a \in(-2,+\infty), p \wedge q$ is true $\Rightarrow a \in(1,2)$. Therefore, the range of real number $a$ is $(-2,1] \cup[2,+\infty)$.