I have a question regarding the complex logarithm which I have studied a long time ago, therefore not everything is clear anymore.

If I remember it correctly then the general complex logarithm is defined to be the solution of $e^{w}=z$. So I mean then in this case if we write $z=re^{i\theta}$ we say that $$w=\log(r)+i(\theta+2\pi k)$$for all $k\in \Bbb{N}$. Did I understand this correctly?

Now I also know that we define the natural branch of logarithm as $$\log:\Bbb{C}\rightarrow \Bbb{C}\setminus (-\infty,0]$$ where $\log(re^{i\theta})=\log(r)+i\theta$ where $\theta\in [-\pi, \pi)$. First, I don’t see how we get from the general definition to this one with natural branch. And in addition, why do we here take out the negative real axis? Is this because for example $-1$ the definition would not make sense since $$\log(-1e^{i-\pi})=log(-1)+(-\pi i)$$ and this means $-\pi i=0$?

What is the detailed explanation?