Index: /trunk/FACT++/src/datalogger.cc
===================================================================
--- /trunk/FACT++/src/datalogger.cc	(revision 14363)
+++ /trunk/FACT++/src/datalogger.cc	(revision 14364)
@@ -222,4 +222,10 @@
 
     DimWriteStatistics fFilesStats;
+
+    ///map and mutex for storing services description
+    map<string, vector<Description> > fServiceDescriptionList;
+    mutex fMutex;
+    int HandleDescriptions(DimDescriptions* desc);
+    vector<Description> GetDescription(const string& server, const string& service);
 private:
     /***************************************************
@@ -378,4 +384,29 @@
 }; //DataLogger
 
+
+/**
+ * @brief the two methods below were copied from StateMachineDimControl.cc
+ *
+ */
+int DataLogger::HandleDescriptions(DimDescriptions* desc)
+{
+    fMutex.lock();
+    for (auto it=desc->descriptions.begin(); it != desc->descriptions.end(); it++) {
+        if (fDebugIsOn)
+        {
+            Debug("Adding description for service: " + it->front().name);
+        }
+        fServiceDescriptionList[it->front().name].assign(it->begin(), it->end());
+    }
+    fMutex.unlock();
+
+    return GetCurrentState();
+}
+vector<Description> DataLogger::GetDescription(const string& server, const string& service)
+{
+    const lock_guard<mutex> guard(fMutex);
+    const auto it = fServiceDescriptionList.find(server+"/"+service);
+    return it==fServiceDescriptionList.end()?vector<Description>():it->second;
+}
 // --------------------------------------------------------------------------
 //
@@ -442,4 +473,5 @@
     {
         DimDescriptions* d = new DimDescriptions(server);
+        d->SetCallbackDescriptions(bind(&DataLogger::HandleDescriptions, this, d));
         d->Subscribe(*this);
         fServerDescriptionsList.push_back(d);
@@ -1190,8 +1222,6 @@
     {
         //write text header
-        header << evt.GetName() << " " << fQuality << " ";
-        header << cTime.Y() << " " << cTime.M() << " " << cTime.D() << " ";
-        header << cTime.h() << " " << cTime.m() << " " << cTime.s() << " ";
-        header << cTime.ms() << " " << evt.GetTime() << " ";
+        header << sub.server << "_" << sub.service << " " << fQuality << " ";
+        header << evt.GetTime() << " ";
 
         string text;
@@ -1241,5 +1271,5 @@
     }
     else
-    {//write entry to both Nightly and run logs
+    {//write entry to Nightly log
         vector<string> strings;
         try
@@ -1265,5 +1295,5 @@
         }
         ostringstream msg;
-        msg << evt.GetName() << ": " << strings[0];
+        msg << sub.server << "_" << sub.service << ": " << strings[0];
 
         if (fNightlyLogFile.is_open())
@@ -1653,5 +1683,5 @@
     str << "Initializing data columns for service " << sub.server << "/" << sub.service;
     Info(str);
-    sub.nightlyFile.InitDataColumns(Description::SplitDescription(evt.GetDescription()), dataFormatsLocal, this);
+    sub.nightlyFile.InitDataColumns(GetDescription(sub.server, sub.service), dataFormatsLocal, this);
 
     sub.fitsBufferAllocated = true;
