Upon Fourier transformation $x\mapsto k$, this becomes a diagonal operator with matrix elements $\langle k|\ln D|k'\rangle=2\pi \delta(k-k')\ln k$. So to find the matrix elements in the $x$-representation we would need to inverseinvert the Fourier transform of the logarithm $\ln k$. From this MSE answer for the Fourier transform of $\ln |k|$ (with absolute value signs) I would conclude that $$\langle x|\ln D|x'\rangle=\left(\frac{i \pi}{2}-\gamma\right) \delta (x-x')+\text{P.V.}\left(\frac{1}{2 (x-x')}-\frac{1}{2 | x-x'| }\right).$$
This notation means that $\ln D$ acting on a function $f$$f(x)$ produces a new function $g$$g(x)$ given by $$g(x)=\int_{-\infty}^\infty \left[\left(\frac{i \pi}{2}-\gamma\right) \delta (x-x')+\text{P.V.}\left(\frac{1}{2 (x-x')}-\frac{1}{2 | x-x'| }\right)\right]f(x')\,dx'$$ $$=\left(\frac{i \pi}{2}-\gamma\right) f(x)+\frac{1}{2}\,\text{P.V.}\int_{-\infty}^\infty \left(\frac{1}{x-x'}-\frac{1}{| x-x'| }\right)\,f(x')\,dx'.$$