record console output to log file