Add logging to the shutdown path, which should be when debugging why sometimes shutdown takes so long.