Logging commands and returning stderror