Die with a useful error if we can't connect to the logging DB

Instead of dying later with a message about prepare failing
That's true.  I'll change it.