Finally clean up the logs by redirecting stdout