1. set daemon thread on monitor thread 2. fix bugs on write logs to file