implement log write in file
implement statistics