uses async method to do logging