Index: trunk/FACT++/src/datalogger.cc
===================================================================
--- trunk/FACT++/src/datalogger.cc	(revision 11405)
+++ trunk/FACT++/src/datalogger.cc	(revision 11406)
@@ -1555,5 +1555,6 @@
         sub.lastReceivedEvent = cTime;
         if (!sub.nightlyFile.IsOpen() || !sub.runFile.IsOpen() || sub.runNumber != sub.runFile.fRunNumber)
-            OpenFITSFilesPlease(sub, cRunNumber);
+            if (GetCurrentState() != kSM_Ready)
+                OpenFITSFilesPlease(sub, cRunNumber);
         WriteToFITS(sub);
 #endif
@@ -2488,9 +2489,10 @@
 //   dim_lock();
    const string baseFileName = CompileFileNameWithPath(fNightlyFilePath, "", "");
-    if (fNightlyLogFile.is_open() && !fDestructing)//in case we're destructing the datalogger, wait before closing the log file.
-    {
-        fNightlyLogFile.close();
-        Info("Closed: "+baseFileName+".log");
-    }
+//we should log everything that we can, even if in Ready state. thus removing this closing (done only in the destructor or at day-change)
+//   if (fNightlyLogFile.is_open() && !fDestructing)//in case we're destructing the datalogger, wait before closing the log file.
+//    {
+//        fNightlyLogFile.close();
+//        Info("Closed: "+baseFileName+".log");
+//    }
     if (fNightlyReportFile.is_open())
     {
@@ -2605,4 +2607,7 @@
          fRunFilePath     = folder;
          fNightlyFilePath = folder;
+         fFullNightlyLogFileName = CompileFileNameWithPath(fNightlyFilePath, "", "log");
+         if (!OpenTextFilePlease(fNightlyLogFile, fFullNightlyLogFileName))
+             SetCurrentState(kSM_BadNightlyConfig);
     }
 
