Electromagnetic logging while drilling (LWD) is one of the key technologies of the geosteering and formation evaluation for high-angle and horizontal wells. In this paper, we solve the dipole source-generated magnetic/electric fields in 2D formations efficiently by the 2.5D finite difference method. Particularly, by leveraging the field's rapid attenuation in spectral domain, we propose truncated Gauss-Hermite quadrature, which is several tens of times faster than traditional inverse fast Fourier transform. By applying the algorithm to the LWD modeling under complex formations, e.g., folds, fault and sandstone pinch-outs, we analyze the feasibility of the dimension reduction from 2D to 1D. For the formations with smooth lateral changes, like folds, the simplified 1D model's results agree well with the true responses, which indicate that the 1D simplification with sliding window is feasible. However, for the formation structures with drastic rock properties changes and sharp boundaries, for instance, faults and sandstone pinch-outs, the simplified 1D model will lead to large errors and, therefore, 2.5D algorithms should be applied to ensure the accuracy.