The function #e^x# considered as a real valued function of real numbers is one to one from #(-oo, oo)# onto #(0, oo)#
Therefore the real valued logarithm is a well defined function from #(0, oo)# onto #(-oo, oo)#
The function #e^z# considered as a complex valued function of complex numbers is many to one from #CC# onto #CC "\" { 0 }#.
In particular, note that #e^(2pii) = 1#. So if #e^z = c# then #e^(z+2npii) = c# for any integer #n#.
Therefore the complex logarithm has multiple branches, with a principal branch from #CC "\" { 0 }# onto #{ x+yi in CC : y in (-pi, pi] }# (using the normal range of #Arg(z) in (-pi, pi]#)
The expression #ln(z)# denotes this principal value.
So whereas #z = 7ipi# is a root of #e^z = -1#, it is not the principal value of #ln(i^2) = ln(-1)#.
The principal value is #ln(-1) = pii#
In general, we can write a formula for the principal value of the logarithm of a complex number #z# as:
#ln z = ln abs(z) + Arg(z) i#