redirect stderr and stdout to log file