You are using the imag function that returns the imaginary part of the function input. The function input in your case will have no imaginary part, and hence, MATLAB returns a matrix of zeros.
I recommend breaking this command into pieces to debug and see where your issue is arising.
moon = imread('moon.tif');
fftOfImage = fft2(moon);
absOfFFT = abs(fftOfImage);
logOfFFT = log(absOfFFT);
If you want to plot the resulting matrix, check out the imagesc function. Hope this helps!