 void logSend(){
   int dotCnt=0;
   boolean bConnected;
+  int upload_fail=0;
 
   //Drv.remove((char*)LOG_FILENAME); // for debug
   // upload log only when wifi ready

                if(Record!="@"){
                  Record.toCharArray(msg, Record.length()+1);
                  Serial.println(msg);

                  mqttPublishRoutine(0);
                  
                  LastPostTime = currentTime;

                  //mqttClient.publish(mqttTopic, msg);
                  //sent the same msg to partner which may monitor this topic, current work around
                  //these delay msg may cause problem to partner, not send it now.
                  //mqttClient.publish(mqttTopicSelf, msg);
                  Serial.print(".");
                  dotCnt++;
                  if((dotCnt % 1) ==0){
                    Serial.println(".");
                  }
                  
                }

          //mqttClient.disconnect();
          // close the file:
          myFile.close();
          if(upload_fail==0){
            Drv.remove((char*)LOG_FILENAME);
            Serial.println("\nUpload complete, log file removed");
          }else{
            Serial.println("\nUpload fail, log file not removed");

          }
          logRecordCnt=0;
      } // if (myFile) 
    } // if(Drv.exists((char*)LOG_FILENAME))
