SD card data acquisition

I am trying to get my program to not only print to the SD card but to also print to the serial monitor/gobetwino. I keep getting mixed results. At this point it keeps just printing high to the serial monitor when it should be in the printing low and it never seems to print low at all. The high and low means that the valve im using is in the on(high) off(low) position. The txt file never prints high or low next to the Run Time at all.

#include <SD.h>

File file;

//void dataLog(char buf[], char buf1[]);


boolean recordTimeZero = true;
unsigned long timeZeroMillis;

void setup()
{

  // Sets analog pins to input
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
  pinMode(A3, INPUT);

  // Sets analog pins to input
  pinMode(3, INPUT);
  pinMode(2, OUTPUT);

  // Opens the serial connection
  Serial.begin(500000);
  SD.begin(10);
  file = SD.open("WR_TEST5.TXT", O_CREAT | O_WRITE);

}

void loop()
{
  unsigned long startTime = 0;
  //unsigned long intreval = 2000UL; // 120 seconds
  unsigned long previousInterval = 0;
  //unsigned long intreval1 = 5000UL; // 60 seconds
  unsigned long previousInterval1 = 0;

  //char tuf[10] = "low";
  //char tuf1[10] = "high";

  delayMicroseconds(10);

  while  (digitalRead(3) == HIGH)
  {

    startTime = millis();
    if (recordTimeZero)
    {
      recordTimeZero = false;
      timeZeroMillis = startTime;
    }

    for (; millis() < startTime + 2000UL;)
    {
      char tuf[10];
      //digitalWrite(2, LOW);
      //sprintf(tuf, "low ");
      if (millis() < startTime + 1000UL)
      {
        //digitalWrite(2, LOW);
        //sprintf(tuf, "low ");
        //Serial.print(tuf);
        dataLog();
      }
      else if (millis() < startTime + 2000UL)
      {
        digitalWrite(2, LOW);
        sprintf(tuf, "low ");
        file.print(tuf);
        dataLog();
      }
      else if (digitalRead(3) == LOW)
      {
        break;
      }

    }

    for (; millis() < startTime + 5000UL;)
    {
      char tuf1[10];
      //digitalWrite(2, HIGH);
      //sprintf(tuf1, "High ");
      if (millis() < startTime + 3000UL)
      {
        digitalWrite(2, HIGH);
        sprintf(tuf1, "High ");
        Serial.print(tuf1);
        dataLog();
      }
      else if (millis() < startTime + 5000UL)
      {
        digitalWrite(2, HIGH);
        sprintf(tuf1, "High ");
        file.print(tuf1);
        dataLog();
      }
      else if (digitalRead(3) == LOW)
      {
        break;
      }

    } file.flush();
  }
}

void dataLog()
{

  char tuf1[10];
  char tuf2[10];
  
  char buf1[50];
  char buf2[100];


  unsigned long runMillis = millis() - timeZeroMillis;
  unsigned long allSeconds = runMillis / 1000;
  int runHours = allSeconds / 3600;
  int secsRemaining = allSeconds % 3600;
  int runMinutes = secsRemaining / 60;
  int runSeconds = secsRemaining % 60;

  int PT1A;
  int PTT1;
  int PT1B;
  int PT1C;

  // Sets values of incoming analog pin data to transducer nnumbers
  PT1A = analogRead(A0); // Reads data from analog pin A0
  PTT1 = analogRead(A1); // Reads data from analog pin A1
  PT1B = analogRead(A2); // Reads data from analog pin A2
  PT1C = analogRead(A3); // Reads data from analog pin A3

  sprintf(buf1, "Runtime%02d:%02d:%02d ", runHours, runMinutes,
          runSeconds);

  sprintf(buf2, "PT1A: %d; PTT1: %d; PT1B: %d; PT1C: %d", PT1A, PTT1, PT1B, PT1C);

  for (; millis() < runMillis + 2000UL;)
  {
    if (millis() < runMillis + 1000UL)
    {
      digitalWrite(2, LOW);
      sprintf(tuf1, "low ");

      Serial.print(tuf1);
      Serial.print(buf1);
      Serial.println(buf2);
    }
    else if (millis() < runMillis + 2000UL)
    {
      digitalWrite(2, LOW);
      sprintf(tuf1, "low ");

      file.print(tuf1);
      file.print(buf1);
      file.println(buf2);
    }
  }

  for (; millis() < runMillis + 5000UL;)
  {
    if (millis() < runMillis + 3000UL)
    {
      digitalWrite(2, HIGH);
      sprintf(tuf2, "high ");

      Serial.print(tuf2);
      Serial.print(buf1);
      Serial.println(buf2);
    }
    else if (millis() < runMillis + 5000UL)
    {
      digitalWrite(2, HIGH);
      sprintf(tuf2, "high ");
      file.print(buf1);
      file.println(buf2);
    }
  }
}

Anyone have any ideas what I could try, or point me in the right direction?