Log command executions to file.