Made logging async again, but logging to console should be in the correct order now.
The only problem with  this is that the log file may be slightly out of order compared to console.