diff --git a/build.sh b/build.sh
index 878aa45ce37381e373e31db4b6948f69368bbc19..b2b0433d05ef124931eab09d2f8858081b96d0ae 100755
--- a/build.sh
+++ b/build.sh
@@ -251,13 +251,13 @@ then
     begin_section "Build$variant"
     build_dir=`build_dir_$arch $variant`
     build_dir_stubs="$build_dir/win_setup/$variant"
-    tee -a $build_log < "$build_dir/build.log" | grep --line-buffered "^##teamcity"
     if `cat "$build_dir/build_ok"`
     then
       echo so far so good.
     else
       record_failure "Parallel build of \"$variant\" failed."
     fi
+    tee -a $build_log < "$build_dir/build.log" | grep --line-buffered "^##teamcity"
     end_section "Build$variant"
   done
   end_section WaitParallel