Negative number in logarithm
Negative logarithms do exist, just not in the real numbers. The complex log function yields the same value as the log function, but on negative numbers it adds a complex component, but which is constant!
As a commenter noted, most books put the integral of $\frac{1}{x}$ as $\ln(|x|)$ to prevent going outside the domain. However, if you allow for complex functions, $\ln(x)$ actually still works. In fact, they are equivalent, if you allow $C$ to be complex, and allow for the fact that you probably shouldn't integrate across the non-smooth point at $x = 0$ (thus you may have different constants of integration).
For instance, for the natural logarithm, logarithms of negative numbers get $i\,\pi$ added to their positive equivalent. Therefore, if, between 0 (the non-smooth point) and $-\infty$, the constant of integration included $-i\,\pi$, then the two definitions would give you the same result.