ln(z) as antiderivative of 1/z

When integrating $$\frac{1}{x}$$ (where $x \in \mathbb{R} $) one gets $$ln|x|+c$$ since for $x>0$ $$(ln|x|+c)'=(ln(x)+c)'=\frac{1}{x}$$ and for $x<0$ $$(ln|x|+c)'=(ln(-x)+c)'=\frac{1}{-x}(-1)=\frac{1}{x}$$

So my first question is: Why do I read everywhere that the antiderivative of $\frac{1}{x}=ln(x)$?

Secondly, when assuming $z \in \mathbb{C}$, we defined in lecture $$Ln_\phi(z)=ln|z|+i\varphi, \varphi \in (\phi,\varphi+2\pi]$$ where $\varphi=arg(z)$.

Question is: $$\int{\frac{1}{z}dz}=?$$ If I would just pretend like $z \in \mathbb{C}$ that would result in $$\int{\frac{1}{z}dz}=Ln_\phi|z|=ln|z|$$ or it's $$\int{\frac{1}{z}dz}=Ln_\phi(z)=ln|z|+i\varphi$$ Obiviously, the two "solutions" are not equal in general so I wonder which one (or neither one) is correct and why.

Thanks!

Edit 1

$\frac{1}{z}=[z=x+iy]=\frac{1}{x+iy}=\frac{x-iy}{x^2+y^2}$, so be $u(x,y)=\frac{x}{x^2+y^2}$ and $v(x,y)=-\frac{y}{x^2+y^2}$. $$u_x=\frac{1}{x^2+y^2}-\frac{2x^2}{(x^2+y^2)^2}=\frac{y^2-x^2}{(x^2+y^2)^2}$$ and $$v_y=-\frac{1}{x^2+y^2}+\frac{2y^2}{(x^2+y^2)^2}=\frac{y^2-x^2}{(x^2+y^2)^2}$$ so the first equation $u_x=v_y$ is fullfilled for $x\neq0,y\neq0$. $$u_y=-\frac{2yx}{(x^2+y^2)^2}$$ and $$v_x=\frac{2xy}{(x^2+y^2)^2}$$ therefore $u_y=-v_x$ for again $x\neq0, y\neq0$, which eventually results in $\frac{1}{z}$ being holomorphic in $\mathbb{C}\setminus\{0\}$

Edit 2

Consider $$\int_\gamma{\frac{z}{z^2+2}dz}$$ where $\gamma$ is a line integral from $z=i$ to $z=i+2\pi$ not containing $z=\pm \sqrt{2}i$, which means in a fitting area the integral is not path-dependent and can therefore be evaluated as $$\int_i^{2\pi}{\frac{z}{z^2+2}dz}$$ Now I'd need a antiderivative of $\frac{z}{z^2+2}$;is the solution then $$\int_i^{2\pi}{\frac{z}{z^2+2}dz}=\frac{1}{2}ln(z^2+2)$$ or $$\int_i^{2\pi}{\frac{z}{z^2+2}dz}=\frac{1}{2}ln|z^2+2|$$?


You are looking for a holomorphic function $f$ so that $f'(z) = \frac 1z$. However, $f$ cannot be defined on $\mathbb C \setminus \{0\}$: If $f$ is defined at $\mathbb C\setminus \{0\}$ consider two ways of evaluating the line integral

$$\int_\gamma \frac 1z dz, $$

where $\gamma(t) = e^{it}$ for $t\in [0,2\pi]$. On the one hand,

$$\int_\gamma \frac{1}{z} dz = \int_0^{2\pi} i dt = 2\pi i \neq 0$$

while

$$\int_\gamma f'(z) dz = f(\gamma(2\pi))- f(\gamma(0)) = 0$$

by the fundamental theorem calculus. So to find an antiderivative of $\frac 1z$, we need to specify a branch. In that case, $Ln (z)$ will be one choice.