Showing $I=\int d^3k\int dk^0\frac{1}{k^4}$ to be logarithmically divergent Consider a momentum integral of the form $$I=\int d^3k\int dk^0\frac{1}{k^4}$$ where $k^2=(k^0)^2-(\vec{k})^2$ and the integral over $k^0$ runs from $-\infty$ to $+\infty$. This integral is common in QFT and I want to show that this integral is logarithmically divergent. The usual trick is to define $$k^0=ik^4$$ so that the integral becomes $$I=\int d^3k\int dk^4\frac{1}{\Big((k^4)^2+(\vec{k})^2\Big)^2}.$$ Now I can go to polar coordinates and do this integral. But a mapping to polar coordinate is possible if all Cartesian quantities vary in the limit $-\infty$ to $\infty$. But the integral over $k^4$ run from $-i\infty$ to $+i\infty$. 
 A: The correct definition of the integral is
$$
I = \int_{\mathbb{R}^3} d^3\mathbf{k}\int_{-\infty}^{\infty} d k^0 \,\frac{1}{(|\mathbf{k}|^2 - (k^0)^2 - i\varepsilon)^2}\,.
$$
The "$+i\varepsilon$" is the so-called $\varepsilon$ prescription which is simply giving you instructions on how to analytically continue this expression.
By this I mean that we now regard the integrand as an analytic function of $k^0$ and the integral as a contour integral on the complex plane. There are many ways of defining such a contour integral, the $i\varepsilon$ tells you which one to pick.
The reason why we choose such a prescription comes from the very definition of the propagator as a time ordered correlator, I'll elaborate on that later.
Now in an analytic function we are free to move the contour around as long as we don't cross any singularity (poles or cuts). In this case (see pictures), we can rotate the contour counter-clockwise without crossing the two poles. Since $\tilde{\infty} \equiv e^{i\theta}\infty$ are all identified as point in $\mathbb{C}$, the endpoints remain fixed.
This means that we are integrating along the imaginary axis $k^0 \in [-i\infty,i\infty]$. Now we can change variables to say $k^0 = i k^4$ and $k^4 \in [-\infty,\infty]$. The integral becomes
$$
I = \int_{\mathbb{R}^4} d^4k \,\frac{1}{\left(\sum_{i=1}^4(k^i)^2\right)^2}\,.
$$
I can drop the $i\varepsilon$ because the ambiguity is resolved. Going to spherical coordinates $\left(\sum_{i=1}^4(k^i)^2\right)^{1/2} = k$, it's easy to see that
$$
I = S_3 \int_0^\Lambda d k\,k^3 \frac{1}{k^4} \propto \log \Lambda\,.
$$
Here $S_3$ is the volume of the sphere $2\pi^2$ and $\Lambda$ a momentum cutoff regulator. The integral is actually also IR divergent, but that's because the propagator is massless. When people say that it's "log divergent," they usually talk about a UV divergent behavior.

Now, back to the why of the $\varepsilon$ prescription. In Lorentzian signature there are more than one solution to the Klein-Gordon equation
$$
(\square + m^2)\,G(x) = \delta(x)\,.
$$
Namely $G(x)$ can be a retarded, advanced, time-ordered correlator, etc... The propagator is the time ordered correlator by definition
$$
\langle 0 | \mathrm{T} \phi(x) \phi(0) | 0 \rangle\,.
$$
The time ordered correlator can be written with the aid of the Heaviside $\Theta$ functions $\Theta(x) = \max\{x,0\}/x$, which can be represented as
$$
\Theta(x) = \frac{1}{2\pi i}\int_{-\infty}^{\infty}dt\,\frac{1}{t-i\varepsilon}e^{ixt}.
$$
Then one can explicitly compute the correlator by inserting a complete set of states
$$
\mathbb{1} = \int_{\mathbb{R^3}} \frac{d^3 \mathbf{k}}{(2\pi)^3} \frac{1}{2E_{\mathbf{k}}} | \mathbf{k} \rangle\langle  \mathbf{k} |\,,\qquad E_{\mathbf{k}}\equiv\sqrt{|\mathbf{k}|^2+m^2}\,,
$$
and using $\langle 0 |\phi(x) | \mathbf{k} \rangle =e^{i \mathbf{k}\cdot \mathbf{x} - i E_{\mathbf{k}}x^0}$.
I'll not go through the details because this is covered in most textbooks. For example $[1]$. Bottom line: if you compute the correlator carefully, the $\varepsilon$ prescription shows up naturally.
There is an alternate way to think about it. Note that in Euclidean signature there is only one correlator (since there is only one solution to the Klein-Gordon equation above), and it is the one with Eclidean-time ordering. This can be seen by inserting a set of energy eigenstantes
$$
\langle \phi(x) \phi(y)\rangle_E = \sum_n \langle 0 |\phi(\mathbf{x},0) | n \rangle\,e^{-E_n (x^4 - y^4)}\,\langle n | \phi(\mathbf{y},0)|0\rangle\,.
$$
Since the energies are unbounded from above, one must have $\Re(x^4 - y^4) > 0$, otherwise this sum explodes.
The way in which we define Lorentzian QFT is by analytic continuation from Euclidean, where things are better defined (in the path integral formulation for example). This means that the Lorentzian propagator is the analytic continuation of the Euclidean one. As I showed in the pictures, the contour can be continuously deformed only if the poles are put in that way.

$\;[1]\;\;$  Michael E. Peskin, Dan V. Schroeder, Frontiers in Physics, An introduction to quantum field theory.



