Monitor stdout when cleaning logs. Closes #179.