As you said, one needs to check for if $f(x)$ is negative. However, here are two reasons for not doing so:
1) Usually $f(x)^{g(x)}$ makes sense only if $f(x) >0$. (However, this need not always be the case- for example take $g(x)=2$. But in that case you would use a different technique anyway)
2) If you want to be very formal and accurate, use the operator $T(h)=\dfrac{h'}{h}$, where $h$ is a function. This would behave exactly like the logarithmic differentiation, if you take $h(x)=f(x)^{g(x)}$ , and you can prove everything formally using this operator, instead of using logarithmic differentiation. So people tend not to worry about logarithmic differentiation, as most of the time, it's a valid method; and even when it's not entirely correct to use logarithmic differentiation, one can get the same results rigorously, using the aforementioned operator.