[Reviewer: Rob] Set up our logging functionality earlier

Rob,

Please can you review my fix to #7?  This is exactly the same as your fix to sprout (https://github.com/Metaswitch/sprout/pull/441).  I've tested this live, but not UT-ed (we don't have a UT for main.cpp).

Thanks,

Matt