add support to log to DataHub

Just adding here what I had emailed so we don't forget. This checks credentials in the main thread on every log event, whereas before it is only checked on startup