adds stdout and stderr logging