Writing log file almost works.