Logging while drilling (LWD) refer to measurements taken down in the well using instruments that travel along with the drill bit and the rest of the bottom hole assembly. While some measurements require drilling to stop momentarily, LWD is distinguished from logging that require you to retract the drill string and do a time-consuming dedicated logging run along the borehole. The advantage of the latter is that it will have a cable to the surface for power and communication, while LWD must make do with power from batteries and mud turbines and communication via mud pulse, wired drill pipe or just storing the data in memory.
While some LWD equipment exist to do simplified downhole mud logging, LWD is usually about measuring properties of the rock formation.
The key difference between LWD and measurement while drilling (MWD) is that whereas LWD data are recorded in memory and downloaded when the tools reach the surface, MWD data are transmitted up the pipe by means of a pressure wave (mud pulsing) at 3 bits/s and monitored in real time.