CPP-159 - Global logging

Looking at this a bit closer I think there might be a memory leak here; thread_ doesn't appear to get deleted anywhere.