1.Dose this code is now the best way to do distribution?

This depends on the application requirements. For available tools, see this: https://pytorch.org/tutorials/beginner/dist_overview.html

2.How to to write logs? In my opinion, We should find the major process and wrtie, but could the mp.spawn can do this?

You can use the rank to control which process does the log, e.g.:
import torch.distributed as dist

if dist.get_rank() == 0:
    # do log

If you are using RPC, the counterpart API is get_worker_info.