fix the PID bug and add multi process write the log