Ensure logging is done asynchronously