add stdout and stderr logging