implement log write in file