Solution (source code)

= Solution

<Green's second identity>, with the outward <normal derivative>, is
$$
\int_S(u\Delta v-v\Delta u)\,dS
=\oint_C\left(u\frac{\partial v}{\partial n}-v\frac{\partial u}{\partial n}\right)dC.
$$
Set $u=\Phi$ and $v=G(\cdot;\mathbf r')$, interpreting the logarithmic singularity by a small excised disc or <distribution theory>. The volume integral is $\Phi(\mathbf r')$ because $\Delta\Phi=0$ and $\Delta G=\delta$. On the boundary $G=0$ and $\Phi=f$, leaving
$$
\boxed{\Phi(\mathbf r')=\oint_C f(\mathbf r)\frac{\partial G(\mathbf r;\mathbf r')}{\partial n}\,dC.}
$$
For the exterior problem below, apply the identity first in a large truncated region. For bounded <harmonic functions> the extra circle at infinity contributes zero: $G$ tends to a constant, its radial derivative is $O(r^{-2})$, and a bounded exterior <harmonic function> also has radial derivative $O(r^{-2})$. This is the condition under which the same boundary representation applies there.