Write log to file.