write log to different files after fork()