Log of a negative number Why is the log of $x$ equal to the log of the absolute value of $x$ plus $i$ times $\pi$?
$$\log(x)=\log(|x|)+i\pi\text{, for }x < 0$$
Where does the $\pi$ come from? Is it from a logarithmic identity?
I know it sounds silly, but I was not able to find an answer from existing solutions: here, here, and here.

Slightly tongue in cheek but partially seriously I'm going to say "magic".
What I mean is before we talk about $\ln -k$ for a negative number we have to define what on earth it could possibly mean to have $e^{m} = -k$. There is no "natural" meaning to that and mathematicians, in one sense, must contrive a meaning for it. If our universe is the real numbers then this is .... impossible. If $b > 0$ then $b^x > 1$ and $e^x$ being negative is simply impossible.
But what if our universe is the complex numbers.  Then if $z = a + bi$ ($i^2 = -1$) then what could $e^{a+bi}$ possibly mean?  After all we can't just "multiply $e$ by itself the square root of negative one times".
Well, we know for real numbers, $e^{x + y} = e^xe^y$ and $\frac {de^x}{dx} = e^x$.  For this to still be true for complex numbers as well as for real numbers the only way to define $e^{z}$ where $z$ is a complex number, so that $e^{z+w} = e^ze^w$ and so that $\frac {d^z}{dz}$ the only possible way for that to stay true we have to define $e^{a+bi} = e^a(\cos b + i \sin b)$.
Okay.  That was ... a lot of hand waving.  But it works and if you study complex analysis it will be derived in great detail.  BUT this means....
$e^{i\pi} = e^{0 + i\pi} =  e^0(\cos \pi + i \sin \pi) = 1*(-1 + i*0) = -1$.
This is Euler's Formula,  one of the most famous mathematical formula in history.
Suddenly $e^z$ being a negative number is not impossible.  But if $e^z$ is negative then we need to have $e^{z} = e^{a + bi} = e^a(\cos b + i \sin b)$ so $\cos b + i \sin b$ is a negative number.  That means $b = \pi$ . So $z = i \pi$.
So this means $\ln -1*x = \ln -1 + \ln x = i\pi + \ln x$. 
And that's where $\pi$ comes from.  When we define $e^{a+bi} = e^a(\cos b + i \sin b)$, exponents become thoroughly linked with trigonometric functions.  As such, $\pi$ is an essential part of the inverse.
For the real numbers only and logs of positive real numbers only, we don't have to worry as $e^x = e^{x + 0*i} = e^x(\cos 0 + i \sin 0) = e^x(1 + i*0) = e^x= k$ and $\ln k = x$ and $\pi$ is not relevant.
