tune log with threading

and add thread test