is this approach correct? $$\log_a b = \frac{\ln b}{\ln a} \tag{1}$$ but from the famous formula $e^{i\pi} = -1$ we can extend the domain of the natural logarithm and have $i\pi = \ln (-1)$ therefore for all real and non-zero a we can have: $$\ln(a) = \ln(|a|\frac{a}{|a|}) = \ln(|a|) + \ln(\frac{a}{|a|}) $$ for example for negative a we have: $$\ln (a) = \ln(|a|) + i\pi$$
and with the formula (1) we can extend this to all real numbers of a and b that are non-zero and the base non-equal to 1. And how can we extend this to quaternions?
Rather than using formula $(1),$ aren't you just applying $\ln$ on both sides then applying the formula $$\ln e^z=z\,?$$ Unfortunately, this formula is not generally applicable for complex $z;$ in fact, $$\ln (-1)=i\pi +i2k\pi.$$
Unfortunately, the formula $$\ln z_1z_2=\ln z_1+\ln z_2$$ is also not generally applicable for complex $z.$
In fact, by the general definition of $\log,$ for $a<0,$ $$\ln (a)=\ln(-a) + i\pi +i2k\pi.$$
OP's comment:
Actually, $\exp(z)$ typically denotes a single-valued function, while $e^z$ is either single-valued or multivalued depending on the context; in Euler's formula above, it is strongly conventional to read $e^{i\pi}$ as single-valued.