Is taking logarithms of complex exponentials allowed/defined? If I take the natural logarithm from both sides of the equation $$ e^{i \varphi_1}=e^{i \varphi_2}; \ \varphi_1, \varphi_2 \in \mathbb{R}$$ I obtain $$i \varphi_1 = i \varphi_2$$ and therefore $\varphi_1=\varphi_2$. However, by Euler's formula, we have $$ i\sin{\varphi_1}+\cos{\varphi_1}=i\sin \varphi_2+\cos{\varphi}_2 $$ and therefore $\varphi_2 =\varphi_1+n\cdot 2\pi$ satisfies the equation $\forall n \in \mathbb{Z}$.
So is there some general rule about these things with complex numbers?