Add logging

I'm not sure. Since the fact that this has to happen *after* relogging is important, it might be worth a note. On the other hand, this is an imperative language and as such order is almost always important.