write last executed cmd to log file for debugging