Fix log level.
Add thread safe check when initializing the log instance.
Add threadId cache.