Enhanced logging to fix bug NMS-5467.