5. Let the function $f(x)=x-\ln (a x+2 a+1)+2$. If for any $x \geqslant-2$, $f(x) \geqslant 0$ always holds, then the range of the real number $a$ is $\qquad$ .
$f(x)=x+2-\ln [a(x+2)+1]$, Let $t=x+2, g(t)=t-\ln (a t+1)$, since $t \geqslant 0$, thus $a \geqslant 0$. Also $g(0)=0$, then $g^{\prime}(t)=1-\frac{a}{a t+1}=\frac{a t+1-a}{a t+1} \geqslant 0$ always holds $\Rightarrow a \leqslant 1$. Therefore, the range of real number $a$ is $[0,1]$.