Added logger messages to while_shutdown function.