add log switch and modify detector

Add an option to select whether to open log or not.
Add a detector to check whether the server setting changed.