DDF-880 Review/refactor all error logging.

Probably the main thing to watch out for here is any inadvertent double-logging. There shouldn't be any functional issues.
Might as well justify XLogger's presence there. Besides, I'm generally a fan of cleaner code.