Index: trunk/BNC/CHANGELOG.md
===================================================================
--- trunk/BNC/CHANGELOG.md	(revision 11184)
+++ trunk/BNC/CHANGELOG.md	(revision 11185)
@@ -1,5 +1,6 @@
 # Changelog
 ## 2.13.8 (2026-11-04)
-- ADDED: **Structured logfile** (General options 'Structured logfile', keys logFileStructured and logFormatStructured): in addition to the unchanged logfile, the same records as JSON Lines ('json', default) or key=value pairs ('logfmt'), daily file '_YYMMDD' like the logfile; each record has time in UTC ('time') and GPS Time ('gpst'), level, component, event, station, the event's fields, the logfile text ('msg') and a version ('v'). Events with fields: ppp_position, ppp_epoch_failed, stream_format, stream_timeout, stream_outage_begin/end, stream_corrupted_begin/end, stream_latency; all other messages as event 'message' with a level from keywords. Test case log_structured and check tests/tools/logcheck.py
+- ADDED: **Structured logfile** (General options 'Structured logfile', 'Format' and 'Min. level', keys logFileStructured, logFormatStructured and logLevelStructured): in addition to the unchanged logfile, the same records as JSON Lines ('json', default) or key=value pairs ('logfmt'), daily file '_YYMMDD' like the logfile; each record has time in UTC ('time') and GPS Time ('gpst'), level, component, event, stream, the event's fields, the logfile text ('msg') and a version ('v'). Events with fields: ppp_position, ppp_epoch_failed, stream_format, stream_content (RTCM scan, with message_type and size of the received message types), stream_timeout, stream_outage_begin/end, stream_corrupted_begin/end, stream_latency; all other messages as event 'message' with the component of their origin (stream, ntrip, bce, ssr, ppp, cmb, upload, ssrqc, bnc) and a level (error: a function does not work; warning: data or configuration problem, BNC continues; info: status); messages of the BNC_DEBUG_BCE/OBS/CMB defines with level 'debug' and component bce/obs/cmb. Test case log_structured and check tests/tools/logcheck.py
+- FIXED: Build with BNC_DEBUG_BCE: undeclared message number in the debug messages of the Galileo ephemeris decoder
 - ADDED: **epoch/velocity fields to PPP coordinates file to allow BNC to propagate the reference coordinates** related to a dedicated reference epoch to the current processing epoch internally; coordinates can also be given as latitude/longitude/height
 - ADDED: **SSR QC** of decoded Broadcast Correction streams (options 'QC Directory', 'QC Streams', 'QC Reference', 'QC Interval'; example configuration '31_SsrQC.bnc'). One daily report file per stream with epochs, declared and actual update intervals, gaps, latency, completeness w.r.t. healthy broadcast ephemerides, IOD matching, code and phase bias signals, yaw angle availability, missing code biases of the reference signals, clock jumps and largest orbit corrections
Index: trunk/BNC/src/RTCM3/RTCM3Decoder.cpp
===================================================================
--- trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 11184)
+++ trunk/BNC/src/RTCM3/RTCM3Decoder.cpp	(revision 11185)
@@ -916,6 +916,6 @@
   else if ((type % 10) < 4) {
 #ifdef BNC_DEBUG_OBS
-    emit(newMessage(QString("%1: Block %2 contain partial data! Ignored!")
-        .arg(_staID).arg(type).toLatin1(), true));
+    emit(newLogRecord(t_logRecord::debugMessage("obs", QString("%1: Block %2 contain partial data! Ignored!")
+        .arg(_staID).arg(type).toLatin1()), true));
 #endif
   }
@@ -1077,8 +1077,8 @@
     if (i < 1 || i > 63 ) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (G) PRN# is out of range: %3!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (G) PRN# is out of range: %3!")
            .arg(_staID)
            .arg(1019,4)
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1089,9 +1089,9 @@
     if (week < 0 || week > 1023) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
            .arg(_staID)
            .arg(1019,4)
            .arg(eph._prn.toString().c_str())
-           .arg(week).toLatin1(), true));
+           .arg(week).toLatin1()), true));
 #endif
       return false;
@@ -1106,9 +1106,9 @@
     if (i < 0 || i > 604784) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOC is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!")
            .arg(_staID)
            .arg(1019,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1128,7 +1128,7 @@
     if (eph._sqrt_A < 1000.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!")
            .arg(_staID).arg(1019,4).arg(eph._prn.toString().c_str())
-           .arg(eph._sqrt_A,10,'F',3).toLatin1(), true));
+           .arg(eph._sqrt_A,10,'F',3).toLatin1()), true));
 #endif
       return false;
@@ -1138,9 +1138,9 @@
     if (i < 0 || i > 604784) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOE is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!")
            .arg(_staID)
            .arg(1019,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1197,8 +1197,8 @@
     if (sv < 1 || sv > 63) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (R):  SLOT# is unknown (0) or out of range: %3!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (R):  SLOT# is unknown (0) or out of range: %3!")
            .arg(_staID)
            .arg(1020,4)
-           .arg(sv).toLatin1(), true));
+           .arg(sv).toLatin1()), true));
 #endif
       return false;
@@ -1210,9 +1210,9 @@
     if (i < 0 || i > 20) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): FRQ CHN# is out of range: %4")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): FRQ CHN# is out of range: %4")
            .arg(_staID)
            .arg(1020,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1226,9 +1226,9 @@
     if (i < 0 || i > 23) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): T_k (bits 11-7) is out of range: %4")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): T_k (bits 11-7) is out of range: %4")
            .arg(_staID)
            .arg(1020,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1238,9 +1238,9 @@
     if (i < 0 || i > 59) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): T_k (bits 6-1) is out of range: %4")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): T_k (bits 6-1) is out of range: %4")
            .arg(_staID)
            .arg(1020,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1250,9 +1250,9 @@
     if (i < 0 || i > 1) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): T_k (bit 0) is out of range: %4")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): T_k (bit 0) is out of range: %4")
            .arg(_staID)
            .arg(1020,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1269,9 +1269,9 @@
     if (i < 15 || i > 1425) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): T_b is out of range: %4")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): T_b is out of range: %4")
            .arg(_staID)
            .arg(1020,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1300,6 +1300,6 @@
     if (eph._M_NT == 0.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): NT = %4: missing data!")
-           .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).arg(eph._M_NT,4).toLatin1(), true));
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): NT = %4: missing data!")
+           .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).arg(eph._M_NT,4).toLatin1()), true));
 #endif
       return false;
@@ -1309,7 +1309,7 @@
     if (eph._additional_data_availability == 0.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): ADD = %4: missing data!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): ADD = %4: missing data!")
            .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str())
-           .arg(eph._additional_data_availability).toLatin1(), true));
+           .arg(eph._additional_data_availability).toLatin1()), true));
 #endif
       return false;
@@ -1331,6 +1331,6 @@
     if (eph._xv.Rows(1,3).NormFrobenius() < 1.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): zero position!")
-           .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).toLatin1(), true));
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): zero position!")
+           .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).toLatin1()), true));
 #endif
       return false;
@@ -1341,6 +1341,6 @@
     if (eph._xv.Rows(4,6).NormFrobenius() < 1.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): zero velocity!")
-           .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).toLatin1(), true));
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): zero velocity!")
+           .arg(_staID).arg(1020,4).arg(eph._prn.toString().c_str()).toLatin1()), true));
 #endif
       return false;
@@ -1386,8 +1386,8 @@
     if (i < 1 || i > 10 ) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (J) SAT ID is out of range: %3!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (J) SAT ID is out of range: %3!")
            .arg(_staID)
            .arg(1044,4)
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1400,9 +1400,9 @@
     if (i < 0 || i > 604784) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOC is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!")
            .arg(_staID)
            .arg(1044,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1423,7 +1423,7 @@
     if (eph._sqrt_A < 1000.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!")
            .arg(_staID).arg(1044,4).arg(eph._prn.toString().c_str())
-           .arg(eph._sqrt_A,10,'F',3).toLatin1(), true));
+           .arg(eph._sqrt_A,10,'F',3).toLatin1()), true));
 #endif
       return false;
@@ -1433,9 +1433,9 @@
     if (i < 0 || i > 604784) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOE is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!")
            .arg(_staID)
            .arg(1044,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1457,9 +1457,9 @@
     if (week < 0 || week > 1023) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
            .arg(_staID)
            .arg(1044,4)
            .arg(eph._prn.toString().c_str())
-           .arg(week).toLatin1(), true));
+           .arg(week).toLatin1()), true));
 #endif
       return false;
@@ -1507,8 +1507,8 @@
     if (i < 1 || i > 63 ) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (I) PRN# is out of range: %3!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (I) PRN# is out of range: %3!")
            .arg(_staID)
            .arg(1041,4)
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1519,9 +1519,9 @@
     if (week < 0 || week > 1023) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
            .arg(_staID)
            .arg(1041,4)
            .arg(eph._prn.toString().c_str())
-           .arg(week).toLatin1(), true));
+           .arg(week).toLatin1()), true));
 #endif
       return false;
@@ -1536,9 +1536,9 @@
     if (i < 0 || i > 1048560) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOC is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!")
            .arg(_staID)
            .arg(1041,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1577,9 +1577,9 @@
     if (i < 0 || i > 1048560) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOE is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!")
            .arg(_staID)
            .arg(1041,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1598,7 +1598,7 @@
     if (eph._sqrt_A < 1000.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!")
            .arg(_staID).arg(1041,4).arg(eph._prn.toString().c_str())
-           .arg(eph._sqrt_A,10,'F',3).toLatin1(), true));
+           .arg(eph._sqrt_A,10,'F',3).toLatin1()), true));
 #endif
       return false;
@@ -1642,8 +1642,8 @@
     if (i < 0 || i > 38 ) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (S) PRN# is out of range: %3!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (S) PRN# is out of range: %3!")
            .arg(_staID)
            .arg(1043,4)
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1656,9 +1656,9 @@
     if (i < 0 || i > 86384) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOC is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!")
            .arg(_staID)
            .arg(1043,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1685,6 +1685,6 @@
     if (pos.NormFrobenius() < 1.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3): zero position!")
-           .arg(_staID).arg(1043,4).arg(eph._prn.toString().c_str()).toLatin1(), true));
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3): zero position!")
+           .arg(_staID).arg(1043,4).arg(eph._prn.toString().c_str()).toLatin1()), true));
 #endif
       return false;
@@ -1720,4 +1720,7 @@
   size -= 6; /* header + crc */
   GETBITS(i, 12)
+#ifdef BNC_DEBUG_BCE
+  const int mnum = i;   // message number for the debug messages
+#endif
 
   if ((i == 1046 && size == 61) ||
@@ -1732,8 +1735,8 @@
     if (i < 1 || i > 36 ) { // max. constellation within I/NAV / F/NAV frames is 36
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (E) PRN# is out of range: %3!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (E) PRN# is out of range: %3!")
            .arg(_staID)
            .arg(mnum,4)
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1745,9 +1748,9 @@
     if (week < 0 || week > 4095) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
            .arg(_staID)
            .arg(mnum,4)
            .arg(eph._prn.toString().c_str())
-           .arg(week).toLatin1(), true));
+           .arg(week).toLatin1()), true));
 #endif
       return false;
@@ -1767,9 +1770,9 @@
     if (i < 0 || i > 604740) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOC is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!")
            .arg(_staID)
            .arg(mnum,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1789,9 +1792,9 @@
     if (i < 0 || i > 604740) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOE is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!")
            .arg(_staID)
            .arg(mnum,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1820,7 +1823,7 @@
       if (eph._E5b_HS != eph._E1B_HS) {
 #ifdef BNC_DEBUG_BCE
-        emit(newMessage(QString("%1: Block %2 (%3) SHS E5b %4 E1B %5: inconsistent health!")
+        emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SHS E5b %4 E1B %5: inconsistent health!")
              .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str())
-             .arg(eph._E5b_HS).arg(eph._E1B_HS).toLatin1(), true));
+             .arg(eph._E5b_HS).arg(eph._E1B_HS).toLatin1()), true));
 #endif
         return false;
@@ -1829,7 +1832,7 @@
           (eph._BGD_1_5B == 0.0 && fabs(eph._BGD_1_5A) > 1e-9)) {
 #ifdef BNC_DEBUG_BCE
-        emit(newMessage(QString("%1: Block %2 (%3) BGD_1_5a = %4 BGD_1_5b = %5: inconsistent BGD!")
+        emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) BGD_1_5a = %4 BGD_1_5b = %5: inconsistent BGD!")
              .arg(_staID).arg(1046,4).arg(eph._prn.toString().c_str())
-             .arg(eph._BGD_1_5A,10,'E',3).arg(eph._BGD_1_5B,10,'E',3).toLatin1(), true));
+             .arg(eph._BGD_1_5A,10,'E',3).arg(eph._BGD_1_5B,10,'E',3).toLatin1()), true));
 #endif
         return false;
@@ -1852,7 +1855,7 @@
     if (eph._sqrt_A < 1000.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!")
            .arg(_staID).arg(eph._inav? 1046 : 1045,4).arg(eph._prn.toString().c_str())
-           .arg(eph._sqrt_A,10,'F',3).toLatin1(), true));
+           .arg(eph._sqrt_A,10,'F',3).toLatin1()), true));
 #endif
       return false;
@@ -1886,8 +1889,8 @@
     if (i < 1 || i > 63 ) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (C) PRN# is out of range: %3!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (C) PRN# is out of range: %3!")
            .arg(_staID)
            .arg(1042,4)
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1899,9 +1902,9 @@
     if (week < 0 || week > 8191) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) WEEK # is out of range: %4!")
            .arg(_staID)
            .arg(1042,4)
            .arg(eph._prn.toString().c_str())
-           .arg(week).toLatin1(), true));
+           .arg(week).toLatin1()), true));
 #endif
       return false;
@@ -1922,9 +1925,9 @@
     if (i < 0 || i > 604792) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOC is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOC is out of range: %4!")
            .arg(_staID)
            .arg(1042,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -1944,7 +1947,7 @@
     if (eph._sqrt_A < 1000.0) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) SQRT_A %4 m!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) SQRT_A %4 m!")
            .arg(_staID).arg(1042,4).arg(eph._prn.toString().c_str())
-           .arg(eph._sqrt_A,10,'F',3).toLatin1(), true));
+           .arg(eph._sqrt_A,10,'F',3).toLatin1()), true));
 #endif
       return false;
@@ -1954,9 +1957,9 @@
     if (i < 0 || i > 604792) {
 #ifdef BNC_DEBUG_BCE
-      emit(newMessage(QString("%1: Block %2 (%3) TOE is out of range: %4!")
+      emit(newLogRecord(t_logRecord::debugMessage("bce", QString("%1: Block %2 (%3) TOE is out of range: %4!")
            .arg(_staID)
            .arg(1042,4)
            .arg(eph._prn.toString().c_str())
-           .arg(i).toLatin1(), true));
+           .arg(i).toLatin1()), true));
 #endif
       return false;
@@ -2329,6 +2332,6 @@
           case 1003:
 #ifdef BNC_DEBUG_OBS
-            emit(newMessage(QString("%1: Block %2 contain partial data! Ignored!")
-                 .arg(_staID).arg(id).toLatin1(), true));
+            emit(newLogRecord(t_logRecord::debugMessage("obs", QString("%1: Block %2 contain partial data! Ignored!")
+                 .arg(_staID).arg(id).toLatin1()), true));
 #endif
             break; /* no use decoding partial data ATM, remove break when data can be used */
@@ -2341,6 +2344,6 @@
           case 1011:
 #ifdef BNC_DEBUG_OBS
-            emit(newMessage(QString("%1: Block %2 contain partial data! Ignored!")
-                 .arg(_staID).arg(id).toLatin1(), true));
+            emit(newLogRecord(t_logRecord::debugMessage("obs", QString("%1: Block %2 contain partial data! Ignored!")
+                 .arg(_staID).arg(id).toLatin1()), true));
 #endif
             break; /* no use decoding partial data ATM, remove break when data can be used */
@@ -2491,6 +2494,6 @@
   if (!_prnOutOfRangeLogged.contains(prnStr)) {
     _prnOutOfRangeLogged.insert(prnStr);
-    emit newMessage(QString("%1: satellite %2 outside the range supported by BNC - not usable for processing")
-                    .arg(_staID).arg(prnStr).toLatin1(), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: satellite %2 outside the range supported by BNC - not usable for processing")
+                    .arg(_staID).arg(prnStr).toLatin1()), true);
   }
 }
Index: trunk/BNC/src/RTCM3/RTCM3Decoder.h
===================================================================
--- trunk/BNC/src/RTCM3/RTCM3Decoder.h	(revision 11184)
+++ trunk/BNC/src/RTCM3/RTCM3Decoder.h	(revision 11185)
@@ -35,4 +35,5 @@
 #include "bncrawfile.h"
 #include "ephemeris.h"
+#include "bnclog.h"
 
 class RTCM3Decoder : public QObject, public GPSDecoder {
@@ -54,4 +55,5 @@
  signals:
   void newMessage(QByteArray msg,bool showOnScreen);
+  void newLogRecord(t_logRecord rec, bool showOnScreen);
   void newGPSEph(t_ephGPS eph);
   void newGlonassEph(t_ephGlo eph);
Index: trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp
===================================================================
--- trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp	(revision 11184)
+++ trunk/BNC/src/RTCM3/RTCM3coDecoder.cpp	(revision 11185)
@@ -96,6 +96,6 @@
           BNC_CORE, SIGNAL(providerIDChanged(QString)), conType);
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)),
-          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
+  BNC_CORE->connectMessages(this, "ssr");
+  BNC_CORE->connectLogRecords(this, "ssr");
 
   reset();
@@ -300,5 +300,5 @@
         }
         else {
-          emit newMessage("RTCM3coDecoder: _lastTime invalid: " + _staID.toLatin1(), true);
+          emit newLogRecord(t_logRecord::message(t_logRecord::warning, "RTCM3coDecoder: _lastTime invalid: " + _staID.toLatin1()), true);
           retCode = failure;
         }
@@ -962,5 +962,5 @@
 
   if (alreadySet && different) {
-    emit newMessage("RTCM3coDecoder: SSR Provider or Service changed " +  newProviderIDStr.toLatin1() + _staID.toLatin1(), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, "RTCM3coDecoder: SSR Provider or Service changed " +  newProviderIDStr.toLatin1() + _staID.toLatin1()), true);
     emit providerIDChanged(_staID);
   }
@@ -1104,7 +1104,7 @@
 
   if (corrIsOutOfRange) {
-    emit newMessage("RTCM3coDecoder: Correction " + ssrParStr.toLatin1()
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, "RTCM3coDecoder: Correction " + ssrParStr.toLatin1()
         + " (" + ssrParValue.toLatin1() + ") "
-        + "is out of range "  + _staID.toLatin1(), true);
+        + "is out of range "  + _staID.toLatin1()), true);
   }
 
@@ -1241,12 +1241,12 @@
         warned = currentTime;
         if (secOfWeek) {
-          emit newMessage(_staID.toLatin1() + ": IGS-SSR GLONASS epoch time erroneously encoded "
+          emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID.toLatin1() + ": IGS-SSR GLONASS epoch time erroneously encoded "
                           "(UTC seconds of week instead of GPS seconds of week, IGS SSR v1.00 IDF003) "
-                          "detected and converted - the SSR encoder should be corrected", true);
+                          "detected and converted - the SSR encoder should be corrected"), true);
         }
         else {
-          emit newMessage(_staID.toLatin1() + ": IGS-SSR GLONASS epoch time in outdated convention "
+          emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID.toLatin1() + ": IGS-SSR GLONASS epoch time in outdated convention "
                           "(UTC seconds of day instead of GPS seconds of week, IGS SSR v1.00 IDF003) "
-                          "detected and converted - the SSR encoder should be updated", true);
+                          "detected and converted - the SSR encoder should be updated"), true);
         }
       }
@@ -1281,7 +1281,7 @@
       if (!warned.valid() || currentTime - warned >= 3600.0) {
         warned = currentTime;
-        emit newMessage(_staID.toLatin1() + ": IGS-SSR BDS epoch time in outdated convention "
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID.toLatin1() + ": IGS-SSR BDS epoch time in outdated convention "
                         "(BDT instead of GPS seconds of week, IGS SSR v1.00 IDF003) "
-                        "detected and converted - the SSR encoder should be updated", true);
+                        "detected and converted - the SSR encoder should be updated"), true);
       }
     }
@@ -1344,10 +1344,10 @@
     if (!warned.valid() || currentTime - warned >= 3600.0) {
       warned = currentTime;
-      emit newMessage(QString("%1: %2 SSR epoch time %3 %4 differs by %5 s from the GPS SSR epoch time "
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: %2 SSR epoch time %3 %4 differs by %5 s from the GPS SSR epoch time "
                               "of the stream - erroneously encoded?")
                       .arg(_staID).arg(epoSys)
                       .arg(QString::fromStdString(_lastTime.datestr()))
                       .arg(QString::fromStdString(_lastTime.timestr(0)))
-                      .arg(_lastTime - _lastGpsEpoch, 0, 'f', 0).toLatin1(), true);
+                      .arg(_lastTime - _lastGpsEpoch, 0, 'f', 0).toLatin1()), true);
     }
   }
@@ -1380,6 +1380,6 @@
   if (!_prnOutOfRangeLogged.contains(prnStr)) {
     _prnOutOfRangeLogged.insert(prnStr);
-    emit newMessage(QString("%1: satellite %2 outside the range supported by BNC - not usable for processing")
-                    .arg(_staID).arg(prnStr).toLatin1(), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: satellite %2 outside the range supported by BNC - not usable for processing")
+                    .arg(_staID).arg(prnStr).toLatin1()), true);
   }
 }
@@ -1421,7 +1421,7 @@
     if (!_antennaIODLogged.contains(key)) {
       _antennaIODLogged.insert(key);
-      emit newMessage(QString("%1: GNSS %2 Satellite Antenna IOD switches back %3 -> %4"
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: GNSS %2 Satellite Antenna IOD switches back %3 -> %4"
                               " - messages of one GNSS must use the same IOD")
-                      .arg(_staID).arg(sys).arg(_antennaIODCur[s]).arg(iod).toLatin1(), true);
+                      .arg(_staID).arg(sys).arg(_antennaIODCur[s]).arg(iod).toLatin1()), true);
     }
   }
Index: trunk/BNC/src/RTCM3/RTCM3coDecoder.h
===================================================================
--- trunk/BNC/src/RTCM3/RTCM3coDecoder.h	(revision 11184)
+++ trunk/BNC/src/RTCM3/RTCM3coDecoder.h	(revision 11185)
@@ -31,4 +31,5 @@
 #include <QMap>
 #include <QSet>
+#include "bnclog.h"
 #include "GPSDecoder.h"
 #include "../RTCM3/clock_and_orbit/clock_orbit_igs.h"
@@ -68,4 +69,5 @@
   void newSatAntennas(QList<t_satAntenna>);
   void newMessage(QByteArray msg, bool showOnScreen);
+  void newLogRecord(t_logRecord rec, bool showOnScreen);
   void providerIDChanged(QString staID);
 
Index: trunk/BNC/src/bnccaster.cpp
===================================================================
--- trunk/BNC/src/bnccaster.cpp	(revision 11184)
+++ trunk/BNC/src/bnccaster.cpp	(revision 11185)
@@ -64,6 +64,6 @@
   bncSettings settings;
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)),
-          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
+  BNC_CORE->connectMessages(this, "bnc");
+  BNC_CORE->connectLogRecords(this, "bnc");
 
   _outFile = 0;
@@ -81,5 +81,5 @@
                       + QByteArray::number(port) + ": "
                       + _server->errorString();
-      emit newMessage(message.toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true);
     }
     connect(_server, SIGNAL(newConnection()), this, SLOT(slotNewConnection()));
@@ -99,5 +99,5 @@
                       + QByteArray::number(uPort) + ": "
                       + _uServer->errorString();
-      emit newMessage(message.toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true);
     }
     connect(_uServer, SIGNAL(newConnection()), this, SLOT(slotNewUConnection()));
@@ -128,5 +128,5 @@
                       + QByteArray::number(_miscPort) + ": "
                       + _miscServer->errorString();
-      emit newMessage(message.toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true);
     }
     connect(_miscServer, SIGNAL(newConnection()), this, SLOT(slotNewMiscConnection()));
@@ -235,9 +235,9 @@
         if ( !settings.value("outFile").toString().isEmpty() ||
              !settings.value("outPort").toString().isEmpty() ) {
-          emit( newMessage(QString("%1: Old or erroneous observation epoch %2 thrown away from %3")
+          emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("%1: Old or erroneous observation epoch %2 thrown away from %3")
           		   .arg(staID.data())
           		   .arg(string(obs._time).c_str())
           		   .arg(obs._prn.toString().c_str())
-        		     .toLatin1(), true) );
+        		     .toLatin1()), true);
         }
       }
@@ -262,12 +262,12 @@
 void bncCaster::slotNewConnection() {
   _sockets->push_back( _server->nextPendingConnection() );
-  emit( newMessage(QString("New client connection on sync port: # %1")
-                   .arg(_sockets->size()).toLatin1(), true) );
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on sync port: # %1")
+                   .arg(_sockets->size()).toLatin1()), true);
 }
 
 void bncCaster::slotNewUConnection() {
   _uSockets->push_back( _uServer->nextPendingConnection() );
-  emit( newMessage(QString("New client connection on usync port: # %1")
-                   .arg(_uSockets->size()).toLatin1(), true) );
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on usync port: # %1")
+                   .arg(_uSockets->size()).toLatin1()), true);
 }
 
@@ -318,6 +318,5 @@
   }
   _staIDs.removeAll(staID);
-  emit( newMessage(
-           QString("Decoding %1 stream(s)").arg(_staIDs.size()).toLatin1(), true) );
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("Decoding %1 stream(s)").arg(_staIDs.size()).toLatin1()), true);
   if (_staIDs.size() == 0) {
     emit getThreadsFinished();
@@ -482,5 +481,5 @@
 
   emit mountPointsRead(_threads);
-  emit(newMessage(QString("Configuration read: " + BNC_CORE->confFileName() + ", %1 stream(s)").arg(_threads.count()).toLatin1(), true));
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("Configuration read: " + BNC_CORE->confFileName() + ", %1 stream(s)").arg(_threads.count()).toLatin1()), true);
 
   // (Re-) Start the configuration timer
@@ -586,6 +585,6 @@
 void bncCaster::slotNewMiscConnection() {
   _miscSockets->push_back( _miscServer->nextPendingConnection() );
-  emit( newMessage(QString("New client connection on Miscellaneous Output Port: # %1")
-                   .arg(_miscSockets->size()).toLatin1(), true) );
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New client connection on Miscellaneous Output Port: # %1")
+                   .arg(_miscSockets->size()).toLatin1()), true);
 }
 
Index: trunk/BNC/src/bnccaster.h
===================================================================
--- trunk/BNC/src/bnccaster.h	(revision 11184)
+++ trunk/BNC/src/bnccaster.h	(revision 11185)
@@ -32,4 +32,5 @@
 #include <QNetworkProxy>
 
+#include "bnclog.h"
 #include "satObs.h"
 #include "upload/bncrawuploadcaster.h"
@@ -56,4 +57,5 @@
    void getThreadsFinished();
    void newMessage(QByteArray msg, bool showOnScreen);
+   void newLogRecord(t_logRecord rec, bool showOnScreen);
    void newObs(QByteArray staID, QList<t_satObs> obsList);
 
Index: trunk/BNC/src/bnccore.cpp
===================================================================
--- trunk/BNC/src/bnccore.cpp	(revision 11184)
+++ trunk/BNC/src/bnccore.cpp	(revision 11185)
@@ -73,4 +73,5 @@
   _logFileStructured  = 0;
   _logFormatStructured = t_logRecord::json;
+  _logLevelStructured  = t_logRecord::debug;
   _rawFile     = 0;
   _caster      = 0;
@@ -149,4 +150,23 @@
   }
   slotLogRecord(t_logRecord::fromMessage(msg), showOnScreen);
+}
+
+// Write a Program Message of a component with an explicit level
+////////////////////////////////////////////////////////////////////////////
+void t_bncCore::message(const QByteArray& msg, bool showOnScreen, const QByteArray& component,
+                        t_logRecord::e_level level) {
+  if (msg.isEmpty()) {
+    return;
+  }
+  slotLogRecord(t_logRecord::message(level, msg, component), showOnScreen);
+}
+
+// Write a Program Message of a component
+////////////////////////////////////////////////////////////////////////////
+void t_bncCore::message(const QByteArray& msg, bool showOnScreen, const QByteArray& component) {
+  if (msg.isEmpty()) {
+    return;
+  }
+  slotLogRecord(t_logRecord::fromMessage(msg, component), showOnScreen);
 }
 
@@ -199,4 +219,6 @@
       _logFormatStructured = t_logRecord::formatFromString(
                                settings.value("logFormatStructured").toString());
+      _logLevelStructured  = t_logRecord::levelFromString(
+                               settings.value("logLevelStructured").toString());
       _logFileStructured = new QFile(structName + "_" + currDate.toString("yyMMdd"));
       if (!_logFileStructured->open(append ? (QIODevice::WriteOnly | QIODevice::Append)
@@ -219,5 +241,5 @@
   }
 
-  if (_logFileStructured) {
+  if (_logFileStructured && rec._level >= _logLevelStructured) {
     _logFileStructured->write(rec.encode(_logFormatStructured, currDateTime) + "\n");
     _logFileStructured->flush();
@@ -232,5 +254,5 @@
 #ifdef BNC_DEBUG_BCE
   if (eph->checkState() == t_eph::unhealthy) {
-    messagePrivate(t_logRecord::fromMessage(QString("%1: UNHEALTHY %2:%3")
+    messagePrivate(t_logRecord::debugMessage("bce", QString("%1: UNHEALTHY %2:%3")
                    .arg(eph->receptStaID())
                    .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
@@ -238,5 +260,5 @@
   }
   if (eph->checkState() == t_eph::bad) {
-    messagePrivate(t_logRecord::fromMessage(QString("%1: WRONG %2:%3")
+    messagePrivate(t_logRecord::debugMessage("bce", QString("%1: WRONG %2:%3")
                    .arg(eph->receptStaID())
                    .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
@@ -244,5 +266,5 @@
   }
   if (eph->checkState() == t_eph::outdated) {
-    messagePrivate(t_logRecord::fromMessage(QString("%1: OUTDATED %2:%3")
+    messagePrivate(t_logRecord::debugMessage("bce", QString("%1: OUTDATED %2:%3")
                    .arg(eph->receptStaID())
                    .arg(eph->typeStr(eph->type(), eph->prn(), 99.0))
@@ -633,5 +655,5 @@
                       + QByteArray::number(_portEph) + ": "
                       + _serverEph->errorString();
-      slotMessage(message.toLatin1(), true);
+      slotLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1(), "bnc"), true);
     }
     connect(_serverEph, SIGNAL(newConnection()), this, SLOT(slotNewConnectionEph()));
@@ -653,5 +675,5 @@
                       + QByteArray::number(_portCorr) + ": "
                       + _serverCorr->errorString();
-      slotMessage(message.toLatin1(), true);
+      slotLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1(), "bnc"), true);
     }
     connect(_serverCorr, SIGNAL(newConnection()), this, SLOT(slotNewConnectionCorr()));
Index: trunk/BNC/src/bnccore.h
===================================================================
--- trunk/BNC/src/bnccore.h	(revision 11184)
+++ trunk/BNC/src/bnccore.h	(revision 11185)
@@ -86,4 +86,31 @@
   int              sigintReceived;
 
+  // Plain text message of a component (structured logfile, see bnclog.h),
+  // level from keywords of the text or explicit
+  void message(const QByteArray& msg, bool showOnScreen, const QByteArray& component);
+  void message(const QByteArray& msg, bool showOnScreen, const QByteArray& component,
+               t_logRecord::e_level level);
+
+  // Messages of an object with a signal newMessage(QByteArray,bool) as records
+  // of the given component; same connection type as a connection to slotMessage
+  template<class T> void connectMessages(T* sender, const char* component) {
+    QByteArray comp(component);
+    connect(sender, &T::newMessage, this, [this, comp](QByteArray msg, bool showOnScreen) {
+      message(msg, showOnScreen, comp);
+    });
+  }
+
+  // Records of an object with a signal newLogRecord(t_logRecord,bool); an empty
+  // component is set to the given one
+  template<class T> void connectLogRecords(T* sender, const char* component) {
+    QByteArray comp(component);
+    connect(sender, &T::newLogRecord, this, [this, comp](t_logRecord rec, bool showOnScreen) {
+      if (rec._component.isEmpty()) {
+        rec._component = comp;
+      }
+      slotLogRecord(rec, showOnScreen);
+    });
+  }
+
   QMap<int, bncTableItem*> _uploadTableItems;
   QMap<int, bncTableItem*> _uploadEphTableItems;
@@ -163,4 +190,5 @@
   QFile*                 _logFileStructured;
   t_logRecord::e_format  _logFormatStructured;
+  t_logRecord::e_level   _logLevelStructured;
   QMutex                 _mutex;
   QMutex                 _mutexMessage;
Index: trunk/BNC/src/bnccredentials.cpp
===================================================================
--- trunk/BNC/src/bnccredentials.cpp	(revision 11184)
+++ trunk/BNC/src/bnccredentials.cpp	(revision 11185)
@@ -51,8 +51,8 @@
 
 // Log a message once per key
-void message(const QString& key, const QString& msg) {
+void message(const QString& key, const QString& msg, t_logRecord::e_level level) {
   if (!_reported.contains(key)) {
     _reported.insert(key);
-    BNC_CORE->slotMessage(msg.toLatin1(), true);
+    BNC_CORE->message(msg.toLatin1(), true, "ntrip", level);
   }
 }
@@ -180,5 +180,5 @@
       message(fileName + QString(":%1").arg(lineNumbers[iLine]),
               QString("Credentials file %1, line %2: not <host> [<port>] <user> <password>, ignored")
-              .arg(fileName).arg(lineNumbers[iLine]));
+              .arg(fileName).arg(lineNumbers[iLine]), t_logRecord::warning);
     }
   }
@@ -205,5 +205,6 @@
     file.refused = true;
     message("perm:" + fileName,
-            QString("Credentials file %1 is readable for other users, not used (chmod 600)").arg(fileName));
+            QString("Credentials file %1 is readable for other users, not used (chmod 600)").arg(fileName),
+            t_logRecord::warning);
     return file;
   }
@@ -212,5 +213,6 @@
   QFile inp(fileName);
   if (!inp.open(QIODevice::ReadOnly | QIODevice::Text)) {
-    message("open:" + fileName, QString("Cannot read credentials file %1").arg(fileName));
+    message("open:" + fileName, QString("Cannot read credentials file %1").arg(fileName),
+            t_logRecord::error);
     return file;
   }
@@ -332,5 +334,6 @@
       message("config:" + account,
               QString("%1: password in the configuration file, it can be moved to a credentials file "
-                      "(option 'credentialsFile', default ~/.netrc)").arg(account));
+                      "(option 'credentialsFile', default ~/.netrc)").arg(account),
+              t_logRecord::info);
     }
     return;
@@ -342,5 +345,5 @@
     QMutexLocker locker(&_mutex);
     message("none:" + account, QString("%1: no password in the configuration file nor in %2")
-            .arg(account).arg(fileNames().join(", ")));
-  }
-}
+            .arg(account).arg(fileNames().join(", ")), t_logRecord::warning);
+  }
+}
Index: trunk/BNC/src/bncephuser.cpp
===================================================================
--- trunk/BNC/src/bncephuser.cpp	(revision 11184)
+++ trunk/BNC/src/bncephuser.cpp	(revision 11185)
@@ -75,5 +75,5 @@
                                                             Qt::SkipEmptyParts);
   if (!_ephMounts.isEmpty()) {
-    BNC_CORE->slotMessage((user.trimmed() + ": ephemerides of " + _ephMounts.join(", ") + " only").toLatin1(), true);
+    BNC_CORE->message((user.trimmed() + ": ephemerides of " + _ephMounts.join(", ") + " only").toLatin1(), true, "bce", t_logRecord::info);
   }
 }
Index: trunk/BNC/src/bncgetthread.cpp
===================================================================
--- trunk/BNC/src/bncgetthread.cpp	(revision 11184)
+++ trunk/BNC/src/bncgetthread.cpp	(revision 11185)
@@ -129,9 +129,7 @@
   setTerminationEnabled(true);
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)),
-  BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
-  connect(this, SIGNAL(newLogRecord(t_logRecord,bool)),
-  BNC_CORE, SLOT(slotLogRecord(t_logRecord,bool)));
-  t_logRecord::registerStation(_staID);
+  BNC_CORE->connectMessages(this, "stream");
+  BNC_CORE->connectLogRecords(this, "stream");
+  t_logRecord::registerStream(_staID);
 
   _isToBeDeleted = false;
@@ -162,5 +160,5 @@
                       + QByteArray::number(nmeaPort) + ": "
                       + _nmeaServer->errorString();
-      emit newMessage(message.toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, message.toLatin1()), true);
     }
     else {
@@ -264,12 +262,12 @@
     msleep(100); //sleep 0.1 sec
     if (!_serialPort->isOpen()) {
-      emit(newMessage(_staID + ": Cannot open serial port " + portString.toLatin1()
-           + ": " + _serialPort->errorString().toLatin1(), true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + ": Cannot open serial port " + portString.toLatin1()
+           + ": " + _serialPort->errorString().toLatin1()), true);
       delete _serialPort;
       _serialPort = 0;
     }
     else {
-      emit(newMessage(_staID + ": Serial port " + portString.toLatin1()
-           + "is connected: " + _serialPort->errorString().toLatin1(), true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::info, _staID + ": Serial port " + portString.toLatin1()
+           + "is connected: " + _serialPort->errorString().toLatin1()), true);
       connect(_serialPort, SIGNAL(readyRead()), this, SLOT(slotSerialReadyRead()));
     }
@@ -343,4 +341,6 @@
     connect((RTCM3Decoder*) newDecoder, SIGNAL(newMessage(QByteArray,bool)),
         this, SIGNAL(newMessage(QByteArray,bool)));
+    connect((RTCM3Decoder*) newDecoder, SIGNAL(newLogRecord(t_logRecord,bool)),
+        this, SIGNAL(newLogRecord(t_logRecord,bool)));
   } else if (_format == "ZERO") {
     emitFormat(": Forward data in original format", "ZERO");
@@ -355,5 +355,5 @@
     _decoder = new bncRtnetDecoder();
   } else {
-    emit(newMessage(_staID + ": Unknown data format " + _format + ". Please change the format entry to ZERO or ZERO2FILE to forward unchanged data.", true));
+    emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + ": Unknown data format " + _format + ". Please change the format entry to ZERO or ZERO2FILE to forward unchanged data."), true);
     _isToBeDeleted = true;
     return failure;
@@ -449,5 +449,5 @@
     try {
       if (_isToBeDeleted) {
-        emit(newMessage(_staID + ": is to be deleted", true));
+        emit newLogRecord(t_logRecord::message(t_logRecord::info, _staID + ": is to be deleted"), true);
         QThread::exit(4);
         this->deleteLater();
@@ -484,10 +484,10 @@
         _format = _rawFile->format();
         _staID = _rawFile->staID();
-        t_logRecord::registerStation(_staID);
+        t_logRecord::registerStream(_staID);
 
         QCoreApplication::processEvents();
 
         if (data.isEmpty() || BNC_CORE->sigintReceived) {
-          emit(newMessage("No more data or SIGINT/SIGTERM received", true));
+          emit newLogRecord(t_logRecord::message(t_logRecord::info, "No more data or SIGINT/SIGTERM received"), true);
           // pass on data the decoders still hold back (last epoch)
           QMapIterator<QString, GPSDecoder*> itFlush(_decodersRaw);
@@ -652,5 +652,5 @@
             QString prn(obs._prn.toString().c_str());
             QString type = QString("%1").arg(obs._type);
-            emit(newMessage(_staID + " (" + prn.toLatin1() + ")" + ": Wrong observation epoch(s)" + "( MT: " + type.toLatin1() + ")", false));
+            emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID + " (" + prn.toLatin1() + ")" + ": Wrong observation epoch(s)" + "( MT: " + type.toLatin1() + ")"), false);
             continue;
           }
@@ -666,8 +666,8 @@
             bncTime oldTime = it.value();
             if (obsTime < oldTime) {
-              emit(newMessage(_staID + ": old observation " + prn.toLatin1(), false));
+              emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID + ": old observation " + prn.toLatin1()), false);
               continue;
             } else if (obsTime == oldTime) {
-              emit(newMessage(_staID + ": observation coming more than once " + prn.toLatin1(), false));
+              emit newLogRecord(t_logRecord::message(t_logRecord::warning, _staID + ": observation coming more than once " + prn.toLatin1()), false);
               continue;
             }
@@ -691,25 +691,25 @@
     }
     catch (Exception& exc) {
-      emit(newMessage(_staID + " " + exc.what(), true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " " + exc.what()), true);
       _isToBeDeleted = true;
     }
     catch (std::exception& exc) {
-      emit(newMessage(_staID + " " + exc.what(), true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " " + exc.what()), true);
       _isToBeDeleted = true;
     }
     catch (const string& error) {
-      emit(newMessage(_staID + " ERROR: " + error.c_str(), true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " ERROR: " + error.c_str()), true);
       _isToBeDeleted = true;
     }
     catch (const char* error) {
-      emit(newMessage(_staID + " ERROR: " + error, true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " ERROR: " + error), true);
       _isToBeDeleted = true;
     }
     catch (QString error) {
-      emit(newMessage(_staID + " ERROR: " + error.toStdString().c_str(), true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " ERROR: " + error.toStdString().c_str()), true);
       _isToBeDeleted = true;
     }
     catch (...) {
-      emit(newMessage(_staID + " bncGetThread: unknown exception", true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, _staID + " bncGetThread: unknown exception"), true);
       _isToBeDeleted = true;
     }
@@ -838,5 +838,11 @@
         QString type = QString("%1 ").arg(decoder()->_typeList[ii]._type);
         QString size = (decoder()->_typeList[ii]._size) ? QString("(size %1)").arg(decoder()->_typeList[ii]._size) : "";
-        emit(newMessage(_staID + ": Received message type " + type.toLatin1() +  size.toLatin1(), true));
+        t_logRecord rec(t_logRecord::info, "stream", "stream_content", _staID,
+                        _staID + ": Received message type " + type.toLatin1() +  size.toLatin1());
+        rec.add("message_type", int(decoder()->_typeList[ii]._type));
+        if (decoder()->_typeList[ii]._size) {
+          rec.add("size", int(decoder()->_typeList[ii]._size));
+        }
+        emit newLogRecord(rec, true);
       }
 
@@ -908,5 +914,5 @@
             str << " " << rnxTypes[iType];
           }
-          emit(newMessage(_staID + ": Observation Types: " + msg.toLatin1(),  true));
+          emitContent(_staID + ": Observation Types: " + msg.toLatin1(),  true);
         }
       }
@@ -916,8 +922,8 @@
       for (int ii = 0; ii < decoder()->_antType.size(); ii++) {
         QString ant1 = QString(": Antenna Descriptor: %1 ").arg(decoder()->_antType[ii]._descriptor);
-        emit(newMessage(_staID + ant1.toLatin1(), true));
+        emitContent(_staID + ant1.toLatin1(), true);
         if (strlen(decoder()->_antType[ii]._serialnumber)) {
           QString ant2 = QString(": Antenna Serial Number: %1 ").arg(decoder()->_antType[ii]._serialnumber);
-          emit(newMessage(_staID + ant2.toLatin1(), true));
+          emitContent(_staID + ant2.toLatin1(), true);
         }
       }
@@ -936,13 +942,13 @@
         ant2 = QString("%1 ").arg(decoder()->_antList[ii]._yy, 0, 'f', 4).toLatin1();
         ant3 = QString("%1 ").arg(decoder()->_antList[ii]._zz, 0, 'f', 4).toLatin1();
-        emit(newMessage(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true));
-        emit(newMessage(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true));
-        emit(newMessage(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true));
+        emitContent(_staID + ": " + antT + " (ITRF) X " + ant1 + "m", true);
+        emitContent(_staID + ": " + antT + " (ITRF) Y " + ant2 + "m", true);
+        emitContent(_staID + ": " + antT + " (ITRF) Z " + ant3 + "m", true);
         double hh = 0.0;
         if (decoder()->_antList[ii]._height_f) {
           hh = decoder()->_antList[ii]._height;
           QByteArray ant4 = QString("%1 ").arg(hh, 0, 'f', 4).toLatin1();
-          emit(newMessage(
-              _staID + ": Antenna height above marker " + ant4 + "m", true));
+          emitContent(
+              _staID + ": Antenna height above marker " + ant4 + "m", true);
         }
         emit(newAntCrd(_staID, decoder()->_antList[ii]._xx,
@@ -956,7 +962,7 @@
         QString rec2 = QString(": Receiver Firmware Version: %1 ").arg(decoder()->_recType[ii]._firmware);
         QString rec3 = QString(": Receiver Serial Number: %1 ").arg(decoder()->_recType[ii]._serialnumber);
-        emit(newMessage(_staID + rec1.toLatin1(), true));
-        emit(newMessage(_staID + rec2.toLatin1(), true));
-        emit(newMessage(_staID + rec3.toLatin1(), true));
+        emitContent(_staID + rec1.toLatin1(), true);
+        emitContent(_staID + rec2.toLatin1(), true);
+        emitContent(_staID + rec3.toLatin1(), true);
       }
 
@@ -973,7 +979,7 @@
         if (!allFound) {
           _gloSlots.sort();
-          emit(newMessage(
+          emitContent(
               _staID + ": GLONASS Slot:Freq " + _gloSlots.join(" ").toLatin1(),
-              true));
+              true);
         }
       }
@@ -983,5 +989,5 @@
       if (decoder()->_gloBiasInfo.changed()) {
         QString gloCodePhaseBiases = decoder()->_gloBiasInfo.toString();
-        emit(newMessage(_staID + gloCodePhaseBiases.toLatin1(), true));
+        emitContent(_staID + gloCodePhaseBiases.toLatin1(), true);
         decoder()->_gloBiasInfo.setChanged(false);
       }
@@ -995,7 +1001,7 @@
           QString coordinateEpoch = QString(": Service CRS Coordinate Epoch: %1 ").arg(decoder()->_serviceCrs[ii]._coordinateEpoch);
           //QString ce = QString(": CE: %1 ").arg(decoder()->_serviceCrs[ii]._CE);
-          emit(newMessage(_staID + servicecrsname.toLatin1(), true));
-          emit(newMessage(_staID + coordinateEpoch.toLatin1(), true));
-          //emit(newMessage(_staID + ce.toLatin1(), true));
+          emitContent(_staID + servicecrsname.toLatin1(), true);
+          emitContent(_staID + coordinateEpoch.toLatin1(), true);
+          //emitContent(_staID + ce.toLatin1(), true);
         }
         // RTCM CRS
@@ -1004,10 +1010,10 @@
           QString anchor      = QString(": RTCM CRS Anchor: %1 ").arg(decoder()->_rtcmCrs[ii]._anchor);
           QString platenumber = QString(": RTCM CRS Plate Number: %1 ").arg(decoder()->_rtcmCrs[ii]._plateNumber);
-          emit(newMessage(_staID + rtcmcrsname.toLatin1(), true));
-          emit(newMessage(_staID + anchor.toLatin1(), true));
-          emit(newMessage(_staID + platenumber.toLatin1(), true));
+          emitContent(_staID + rtcmcrsname.toLatin1(), true);
+          emitContent(_staID + anchor.toLatin1(), true);
+          emitContent(_staID + platenumber.toLatin1(), true);
           for (int i = 0; i<decoder()->_rtcmCrs[ii]._databaseLinks.size(); i++) {
             QString dblink = QString(": Database Link: %1 ").arg(decoder()->_rtcmCrs[ii]._databaseLinks[i]);
-            emit(newMessage(_staID + dblink.toLatin1(), true));
+            emitContent(_staID + dblink.toLatin1(), true);
           }
         }
@@ -1030,12 +1036,12 @@
               .arg(helmertPar._oxr).arg(helmertPar._oyr).arg(helmertPar._ozr);
           QString parscale = QString(": MT1301 Helmert Par Scale: sc = %1, scr = %2").arg(helmertPar._sc).arg(helmertPar._scr);
-          emit(newMessage(_staID + sourcename.toLatin1(), true));
-          emit(newMessage(_staID + targetname.toLatin1(), true));
-          emit(newMessage(_staID + sysidentnum.toLatin1(), true));
-          emit(newMessage(_staID + trafomessageind.toLatin1(), true));
-          emit(newMessage(_staID + epoch.toLatin1(), true));
-          emit(newMessage(_staID + partrans.toLatin1(), true));
-          emit(newMessage(_staID + parrot.toLatin1(), true));
-          emit(newMessage(_staID + parscale.toLatin1(), true));
+          emitContent(_staID + sourcename.toLatin1(), true);
+          emitContent(_staID + targetname.toLatin1(), true);
+          emitContent(_staID + sysidentnum.toLatin1(), true);
+          emitContent(_staID + trafomessageind.toLatin1(), true);
+          emitContent(_staID + epoch.toLatin1(), true);
+          emitContent(_staID + partrans.toLatin1(), true);
+          emitContent(_staID + parrot.toLatin1(), true);
+          emitContent(_staID + parscale.toLatin1(), true);
         }
       }
@@ -1124,7 +1130,5 @@
 void bncGetThread::slotNewNMEAConnection() {
   _nmeaSockets->push_back(_nmeaServer->nextPendingConnection());
-  emit(newMessage(
-      QString("New PPP client on port: # %1").arg(_nmeaSockets->size()).toLatin1(),
-      true));
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("New PPP client on port: # %1").arg(_nmeaSockets->size()).toLatin1()), true);
 }
 
@@ -1157,2 +1161,9 @@
   emit newLogRecord(rec, true);
 }
+
+// Content of the stream found by the RTCM scan (miscScanRTCM)
+////////////////////////////////////////////////////////////////////////////
+void bncGetThread::emitContent(const QByteArray& msg, bool showOnScreen) {
+  emit newLogRecord(t_logRecord(t_logRecord::info, "stream", "stream_content", _staID, msg),
+                    showOnScreen);
+}
Index: trunk/BNC/src/bncgetthread.h
===================================================================
--- trunk/BNC/src/bncgetthread.h	(revision 11184)
+++ trunk/BNC/src/bncgetthread.h	(revision 11185)
@@ -103,4 +103,5 @@
    t_irc        initDecoder();
    void         emitFormat(const char* text, const char* decoder);
+   void         emitContent(const QByteArray& msg, bool showOnScreen);
    GPSDecoder* decoder();
 
Index: trunk/BNC/src/bnchelp.html
===================================================================
--- trunk/BNC/src/bnchelp.html	(revision 11184)
+++ trunk/BNC/src/bnchelp.html	(revision 11185)
@@ -2789,5 +2789,7 @@
     'json' for one JSON object per line (JSON Lines) or 'logfmt' for key=value pairs separated by blanks. As for the
     logfile, the name is extended by '_YYMMDD'. The logfile itself remains unchanged, so existing scripts reading it
-    keep working. Default is an empty option field, meaning that no structured logfile is written.
+    keep working. Default is an empty option field, meaning that no structured logfile is written. 'Min. level'
+    restricts the structured logfile to records of at least the selected level: 'debug' (default) writes all records,
+    'info' leaves out the debug records, 'warning' writes warnings and errors, 'error' errors only.
   </p>
   <p>
@@ -2797,8 +2799,12 @@
     <li>'time': time of the record in UTC, ISO 8601 with 'Z', e.g. '2025-11-17T13:49:40.000Z',</li>
     <li>'gpst': the same time in GPS Time (as the time stamps of the logfile), e.g. '2025-11-17T13:49:58.000',</li>
-    <li>'level': 'info', 'warning' or 'error',</li>
-    <li>'component': the part of BNC writing the record, e.g. 'stream', 'ppp', or 'bnc' for general messages,</li>
+    <li>'level': 'debug', 'info', 'warning' or 'error'; debug records exist only in BNC versions built with the
+        defines BNC_DEBUG_BCE, BNC_DEBUG_OBS or BNC_DEBUG_CMB (src/src.pri),</li>
+    <li>'component': the part of BNC writing the record: 'stream' (stream retrieval and decoding, latency, outages,
+        RTCM scan, raw file input), 'ntrip' (Ntrip and UDP/RTP queries, credentials), 'obs' (observation decoding,
+        debug), 'bce' (broadcast ephemerides), 'ssr' (SSR decoding), 'ppp', 'cmb' (combination), 'upload', 'ssrqc'
+        (SSR QC), or 'bnc' for general messages,</li>
     <li>'event': the kind of record, see below, or 'message' for general messages,</li>
-    <li>'station': the stream or PPP station, if known,</li>
+    <li>'stream': the stream (mountpoint) or the PPP station, if known,</li>
     <li>the fields of the event,</li>
     <li>'msg': the text of the record in the logfile,</li>
@@ -2813,4 +2819,7 @@
     <li>'stream_format': 'decoder' (RTCM2, RTCM3, ZERO, ZERO2FILE, RTNET) and 'format' (format entry of the stream),</li>
     <li>'stream_timeout' (warning): data timeout, BNC reconnects,</li>
+    <li>'stream_content': content of the stream found by the RTCM scan (see section <a href=#miscscan>2.12.3</a>), e.g. observation
+        types, antenna and receiver descriptors, antenna coordinates, GLONASS slots, CRS and Helmert parameters; for the
+        received message types with the fields 'message_type' and, if known, 'size' (bytes),</li>
     <li>'stream_outage_begin' (warning), 'stream_corrupted_begin' (warning): 'since' (UTC);
         'stream_outage_end', 'stream_corrupted_end': 'ended' and 'since' (UTC),</li>
@@ -2819,7 +2828,9 @@
   </ul>
   <p>
-    All other messages are written with component 'bnc' and event 'message'. Their level is derived from keywords of
-    the text ('error', 'fail', 'cannot', ... give 'error'; 'warning', 'outage', 'corrupt', 'timeout', 'wrong',
-    'invalid', 'ignored', 'unknown', ... give 'warning'). Further events will follow; new keys may be added to a record
+    All other messages are written with event 'message' and the component of their origin; the messages of the
+    BNC_DEBUG_* defines with level 'debug'. The levels mean: 'error' - a function does not work (e.g. stream,
+    upload or PPP not possible, a file cannot be read, BNC exits); 'warning' - a data or configuration problem,
+    BNC continues (e.g. data dropped, reconnect, default used, AC or satellite excluded from the combination);
+    'info' - status. Further events will follow; new keys may be added to a record
     without changing its version, removed or renamed keys increase the version.
   </p>
@@ -2828,6 +2839,6 @@
   </p>
   <pre><p style="font-family:Monospace">
-{"time":"2025-11-17T13:48:51.000Z","gpst":"2025-11-17T13:49:09.000","level":"info","component":"stream","event":"stream_format","station":"BCEP00BKG0","decoder":"RTCM3","format":"RTCM_3.3","msg":"BCEP00BKG0: Get data in RTCM 3.x format","v":1}
-{"time":"2025-11-17T13:49:40.000Z","gpst":"2025-11-17T13:49:58.000","level":"info","component":"ppp","event":"ppp_position","station":"WTZR00DEU0","epoch":"2025-11-17T13:49:10.000","x":4075580.2172,"y":931854.1555,"z":4801568.3403,"dn":0.0000,"de":0.0000,"du":0.0001,"trp0":2.1833,"trp":0.0019,"trp_stdev":0.0993,"num_sat":17,"hdop":0.59,"fixed":false,"fix_percent":0,"msg":"2025-11-17_13:49:10.000 WTZR00DEU0 X = 4075580.2172 ...","v":1}
+{"time":"2025-11-17T13:48:51.000Z","gpst":"2025-11-17T13:49:09.000","level":"info","component":"stream","event":"stream_format","stream":"BCEP00BKG0","decoder":"RTCM3","format":"RTCM_3.3","msg":"BCEP00BKG0: Get data in RTCM 3.x format","v":1}
+{"time":"2025-11-17T13:49:40.000Z","gpst":"2025-11-17T13:49:58.000","level":"info","component":"ppp","event":"ppp_position","stream":"WTZR00DEU0","epoch":"2025-11-17T13:49:10.000","x":4075580.2172,"y":931854.1555,"z":4801568.3403,"dn":0.0000,"de":0.0000,"du":0.0001,"trp0":2.1833,"trp":0.0019,"trp_stdev":0.0993,"num_sat":17,"hdop":0.59,"fixed":false,"fix_percent":0,"msg":"2025-11-17_13:49:10.000 WTZR00DEU0 X = 4075580.2172 ...","v":1}
 </pre>
   </p>
@@ -2836,6 +2847,6 @@
   </p>
   <pre><p style="font-family:Monospace">
-time=2025-11-17T13:48:51.000Z gpst=2025-11-17T13:49:09.000 level=info component=stream event=stream_format station=BCEP00BKG0 decoder=RTCM3 format=RTCM_3.3 msg="BCEP00BKG0: Get data in RTCM 3.x format" v=1
-time=2025-11-17T13:49:40.000Z gpst=2025-11-17T13:49:58.000 level=info component=ppp event=ppp_position station=WTZR00DEU0 epoch=2025-11-17T13:49:10.000 x=4075580.2172 y=931854.1555 z=4801568.3403 dn=0.0000 de=0.0000 du=0.0001 trp0=2.1833 trp=0.0019 trp_stdev=0.0993 num_sat=17 hdop=0.59 fixed=false fix_percent=0 msg="2025-11-17_13:49:10.000 WTZR00DEU0 X = 4075580.2172 ..." v=1
+time=2025-11-17T13:48:51.000Z gpst=2025-11-17T13:49:09.000 level=info component=stream event=stream_format stream=BCEP00BKG0 decoder=RTCM3 format=RTCM_3.3 msg="BCEP00BKG0: Get data in RTCM 3.x format" v=1
+time=2025-11-17T13:49:40.000Z gpst=2025-11-17T13:49:58.000 level=info component=ppp event=ppp_position stream=WTZR00DEU0 epoch=2025-11-17T13:49:10.000 x=4075580.2172 y=931854.1555 z=4801568.3403 dn=0.0000 de=0.0000 du=0.0001 trp0=2.1833 trp=0.0019 trp_stdev=0.0993 num_sat=17 hdop=0.59 fixed=false fix_percent=0 msg="2025-11-17_13:49:10.000 WTZR00DEU0 X = 4075580.2172 ..." v=1
 </pre>
   </p>
@@ -11148,4 +11159,5 @@
    logFileStructured {Structured logfile in addition to the logfile, full path [character string]}
    logFormatStructured {Format of the structured logfile [character string: json|logfmt]}
+   logLevelStructured {Minimum level of the records in the structured logfile [character string: debug|info|warning|error]}
    rnxAppend        {Append files [integer number: 0=no,2=yes]}
    onTheFlyInterval {Configuration reload interval [character string: no|1 day|1 hour|5 min|1 min]}
Index: trunk/BNC/src/bnclog.cpp
===================================================================
--- trunk/BNC/src/bnclog.cpp	(revision 11184)
+++ trunk/BNC/src/bnclog.cpp	(revision 11185)
@@ -24,6 +24,6 @@
 namespace {
 
-QMutex          stationMutex;
-QSet<QByteArray> stations;
+QMutex          streamMutex;
+QSet<QByteArray> streams;
 
 // text as UTF-8 (BNC's messages are Latin-1)
@@ -97,8 +97,8 @@
 // Envelope of a plain text message
 ////////////////////////////////////////////////////////////////////////////
-t_logRecord t_logRecord::fromMessage(const QByteArray& msg) {
-  t_logRecord rec(info, "bnc", "message", "", msg);
-
-  // station: first token of the text, if it is a known station name
+t_logRecord t_logRecord::fromMessage(const QByteArray& msg, const QByteArray& component) {
+  t_logRecord rec(info, component, "message", "", msg);
+
+  // stream: first token of the text, if it is a known stream or PPP station
   int end = 0;
   while (end < msg.size() && msg[end] != ':' && msg[end] != ' ' && msg[end] != '(') {
@@ -107,7 +107,7 @@
   if (end > 0) {
     QByteArray token = msg.left(end);
-    QMutexLocker locker(&stationMutex);
-    if (stations.contains(token)) {
-      rec._station = token;
+    QMutexLocker locker(&streamMutex);
+    if (streams.contains(token)) {
+      rec._stream = token;
     }
   }
@@ -136,4 +136,21 @@
 }
 
+// Plain text message with an explicit level
+////////////////////////////////////////////////////////////////////////////
+t_logRecord t_logRecord::message(e_level level, const QByteArray& msg,
+                                 const QByteArray& component) {
+  t_logRecord rec = fromMessage(msg, component);
+  rec._level = level;
+  return rec;
+}
+
+// Message of a BNC_DEBUG_* build
+////////////////////////////////////////////////////////////////////////////
+t_logRecord t_logRecord::debugMessage(const QByteArray& component, const QByteArray& msg) {
+  t_logRecord rec = fromMessage(msg, component);
+  rec._level = debug;
+  return rec;
+}
+
 //
 ////////////////////////////////////////////////////////////////////////////
@@ -196,4 +213,5 @@
 const char* t_logRecord::levelString(e_level level) {
   switch (level) {
+    case debug:   return "debug";
     case warning: return "warning";
     case error:   return "error";
@@ -210,10 +228,20 @@
 //
 ////////////////////////////////////////////////////////////////////////////
-void t_logRecord::registerStation(const QByteArray& station) {
-  if (station.isEmpty()) {
+t_logRecord::e_level t_logRecord::levelFromString(const QString& str) {
+  QString ss = str.trimmed().toLower();
+  if (ss == "info")    return info;
+  if (ss == "warning") return warning;
+  if (ss == "error")   return error;
+  return debug;
+}
+
+//
+////////////////////////////////////////////////////////////////////////////
+void t_logRecord::registerStream(const QByteArray& stream) {
+  if (stream.isEmpty()) {
     return;
   }
-  QMutexLocker locker(&stationMutex);
-  stations.insert(station);
+  QMutexLocker locker(&streamMutex);
+  streams.insert(stream);
 }
 
@@ -242,6 +270,6 @@
   put("component", _component, true);
   put("event",     _event, true);
-  if (!_station.isEmpty()) {
-    put("station", _station, true);
+  if (!_stream.isEmpty()) {
+    put("stream", _stream, true);
   }
   all += _fields;
Index: trunk/BNC/src/bnclog.h
===================================================================
--- trunk/BNC/src/bnclog.h	(revision 11184)
+++ trunk/BNC/src/bnclog.h	(revision 11185)
@@ -36,8 +36,9 @@
 // logfile gets one line per record, JSON (JSON Lines) or logfmt:
 //
-//   time gpst level component event [station] [fields ...] msg v
+//   time gpst level component event [stream] [fields ...] msg v
 //
 // Messages that are still emitted as plain text (newMessage(QByteArray,bool))
-// become records with component "bnc" and event "message"; the station is
+// become records with event "message" and the component of their sender
+// (t_bncCore::connectMessages(), default "bnc"); the stream is
 // taken from the text prefix if it is a known stream or PPP station, the
 // level from keywords of the text (fromMessage()).
@@ -45,5 +46,5 @@
 class t_logRecord {
  public:
-  enum e_level {info, warning, error};
+  enum e_level {debug, info, warning, error};   // increasing severity
   enum e_format {json, logfmt};
 
@@ -53,9 +54,17 @@
   t_logRecord() : _level(info) {}
   t_logRecord(e_level level, const QByteArray& component, const QByteArray& event,
-              const QByteArray& station, const QByteArray& msg)
-    : _level(level), _component(component), _event(event), _station(station), _msg(msg) {}
+              const QByteArray& stream, const QByteArray& msg)
+    : _level(level), _component(component), _event(event), _stream(stream), _msg(msg) {}
 
   // envelope of a plain text message
-  static t_logRecord fromMessage(const QByteArray& msg);
+  static t_logRecord fromMessage(const QByteArray& msg, const QByteArray& component = "bnc");
+
+  // plain text message with an explicit level, event "message"; an empty
+  // component is filled by the connection (t_bncCore::connectLogRecords())
+  static t_logRecord message(e_level level, const QByteArray& msg,
+                             const QByteArray& component = QByteArray());
+
+  // message of a BNC_DEBUG_* build: level debug, event "message"
+  static t_logRecord debugMessage(const QByteArray& component, const QByteArray& msg);
 
   // fields in the order added; numbers are written with the C locale
@@ -70,13 +79,15 @@
 
   static e_format formatFromString(const QString& str);
+  static e_level  levelFromString(const QString& str);       // default debug
   static const char* levelString(e_level level);
 
-  // station names known for the prefix of plain text messages (thread safe)
-  static void registerStation(const QByteArray& station);
+  // stream (mountpoint) and PPP station names known for the prefix of plain
+  // text messages (thread safe)
+  static void registerStream(const QByteArray& stream);
 
   e_level    _level;
   QByteArray _component;
   QByteArray _event;
-  QByteArray _station;
+  QByteArray _stream;
   QByteArray _msg;
 
Index: trunk/BNC/src/bncmain.cpp
===================================================================
--- trunk/BNC/src/bncmain.cpp	(revision 11184)
+++ trunk/BNC/src/bncmain.cpp	(revision 11185)
@@ -149,4 +149,5 @@
         "   logFileStructured {Structured logfile in addition to the logfile, full path [character string]}\n"
         "   logFormatStructured {Format of the structured logfile [character string: json|logfmt]}\n"
+        "   logLevelStructured {Minimum level of the records in the structured logfile [character string: debug|info|warning|error]}\n"
         "   rnxAppend        {Append files [integer number: 0=no,2=yes]}\n"
         "   onTheFlyInterval {Configuration reload interval [character string: no|1 day|1 hour|5 min|1 min]}\n"
@@ -450,13 +451,4 @@
 #endif
 
-#ifdef Q_OS_MACX
-    if (QSysInfo::MacintoshVersion > QSysInfo::MV_10_8)
-    {
-        // fix Mac OS X 10.9 (mavericks) font issue
-        // https://bugreports.qt-project.org/browse/QTBUG-32789
-        QFont::insertSubstitution(".Lucida Grande UI", "Lucida Grande");
-    }
-#endif
-
     bool GUIenabled = interactive || displaySet;
     QScopedPointer<QCoreApplication> app(createApplication(argc, argv, GUIenabled));
@@ -575,5 +567,5 @@
         BNC_CORE->connect(caster, SIGNAL(getThreadsFinished()), app->instance(), SLOT(quit()));
 
-        BNC_CORE->slotMessage("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true);
+        BNC_CORE->message("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true, "bnc", t_logRecord::info);
 
 
@@ -586,5 +578,5 @@
             caster->readMountPoints();
             if (caster->numStations() == 0) {
-                BNC_CORE->slotMessage("bncMain: number of caster stations: 0 => exit", true);
+                BNC_CORE->message("bncMain: number of caster stations: 0 => exit", true, "bnc", t_logRecord::error);
                 exit(3);
             }
Index: trunk/BNC/src/bncnetquery.h
===================================================================
--- trunk/BNC/src/bncnetquery.h	(revision 11184)
+++ trunk/BNC/src/bncnetquery.h	(revision 11185)
@@ -5,4 +5,5 @@
 #include <QUrl>
 
+#include "bnclog.h"
 #include "bncconst.h"
 #include "bnccore.h"
@@ -15,6 +16,6 @@
 
   bncNetQuery() {
-    connect(this,     SIGNAL(newMessage(QByteArray,bool)),
-            BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
+    BNC_CORE->connectMessages(this, "ntrip");
+    BNC_CORE->connectLogRecords(this, "ntrip");
   }
   virtual ~bncNetQuery() {}
@@ -34,4 +35,5 @@
  signals:
   void newMessage(QByteArray msg, bool showOnScreen);
+  void newLogRecord(t_logRecord rec, bool showOnScreen);
 
  private slots:
Index: trunk/BNC/src/bncnetqueryrtp.cpp
===================================================================
--- trunk/BNC/src/bncnetqueryrtp.cpp	(revision 11184)
+++ trunk/BNC/src/bncnetqueryrtp.cpp	(revision 11185)
@@ -231,6 +231,6 @@
               while (!line.isEmpty() && ++nLines <= maxHeaderLines) {
                 if (line.indexOf("200 OK") != -1) {
-                  emit newMessage(_url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"")
-                            + ": UDP connection established", true);
+                  emit newLogRecord(t_logRecord::message(t_logRecord::info, _url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"")
+                            + ": UDP connection established"), true);
                   slotKeepAlive();
                   return;
@@ -248,6 +248,6 @@
   _socket = 0;
   _status = error;
-  emit newMessage(_url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"")
-                  + ": NetQuery, waiting for connect", true);
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, _url.toEncoded(QUrl::RemoveUserInfo).replace(0,1,"")
+                  + ": NetQuery, waiting for connect"), true);
 }
 
Index: trunk/BNC/src/bncnetquerys.cpp
===================================================================
--- trunk/BNC/src/bncnetquerys.cpp	(revision 11184)
+++ trunk/BNC/src/bncnetquerys.cpp	(revision 11185)
@@ -191,6 +191,6 @@
 
   if (!_serialPort->isOpen()) {
-    emit newMessage(_url.path().toLatin1().replace(0,1,"") + ": Cannot open serial port " + _portString.toLatin1()
-                    + ": " + _serialPort->errorString().toLatin1(), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::error, _url.path().toLatin1().replace(0,1,"") + ": Cannot open serial port " + _portString.toLatin1()
+                    + ": " + _serialPort->errorString().toLatin1()), true);
     delete _serialPort;
     _serialPort = 0;
@@ -199,6 +199,6 @@
   }
   else {
-    emit(newMessage(_url.path().toLatin1().replace(0,1,"") + ": Serial port " + _portString.toLatin1()
-                    + " is connected: " , true));
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, _url.path().toLatin1().replace(0,1,"") + ": Serial port " + _portString.toLatin1()
+                    + " is connected: "), true);
     _status = running;
   }
Index: trunk/BNC/src/bncnetqueryudp0.cpp
===================================================================
--- trunk/BNC/src/bncnetqueryudp0.cpp	(revision 11184)
+++ trunk/BNC/src/bncnetqueryudp0.cpp	(revision 11185)
@@ -100,6 +100,6 @@
       _senders = QHostInfo::fromName(host).addresses();
       if (_senders.isEmpty()) {
-        emit newMessage(url.path().toLatin1().replace(0,1,"") +
-                        ": Cannot resolve UDP sender " + host.toLatin1(), true);
+        emit newLogRecord(t_logRecord::message(t_logRecord::error, url.path().toLatin1().replace(0,1,"") +
+                        ": Cannot resolve UDP sender " + host.toLatin1()), true);
         _status = error;
         return;
Index: trunk/BNC/src/bncnetqueryv0.cpp
===================================================================
--- trunk/BNC/src/bncnetqueryv0.cpp	(revision 11184)
+++ trunk/BNC/src/bncnetqueryv0.cpp	(revision 11185)
@@ -67,5 +67,5 @@
         _socket = 0;
         _status = error;
-        emit newMessage(_url.path().toLatin1() + " read timeout", true);
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1() + " read timeout"), true);
         return;
       }
@@ -102,6 +102,6 @@
     _socket = 0;
     _status = error;
-      emit(newMessage(_url.path().toLatin1().replace(0,1,"")
-                      + ": Connect timeout, reconnecting", true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")
+                      + ": Connect timeout, reconnecting"), true);
     return;
   }
@@ -115,6 +115,6 @@
       _socket = 0;
       _status = error;
-      emit newMessage(_url.path().toLatin1().replace(0,1,"")
-                      + ": Read timeout", true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")
+                      + ": Read timeout"), true);
       return;
     }
Index: trunk/BNC/src/bncnetqueryv1.cpp
===================================================================
--- trunk/BNC/src/bncnetqueryv1.cpp	(revision 11184)
+++ trunk/BNC/src/bncnetqueryv1.cpp	(revision 11185)
@@ -91,6 +91,6 @@
         _socket = 0;
         _status = error;
-        emit newMessage(_url.path().toLatin1().replace(0,1,"")
-                        + ": " + errStr.toLatin1(), true);
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")
+                        + ": " + errStr.toLatin1()), true);
         return;
       }
@@ -157,6 +157,6 @@
      _socket = 0;
      _status = error;
-     emit newMessage(_url.path().toLatin1().replace(0,1,"")
-                     + ": Write timeout", true);
+     emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")
+                     + ": Write timeout"), true);
      return;
    }
@@ -243,6 +243,6 @@
     _socket = 0;
     _status = error;
-    emit newMessage(_url.path().toLatin1().replace(0,1,"")
-                    + ": Write timeout", true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")
+                    + ": Write timeout"), true);
     return;
   }
@@ -265,6 +265,6 @@
           _socket = 0;
           _status = error;
-          emit newMessage(_url.path().toLatin1().replace(0,1,"")
-                          + ": Caster response header too long", true);
+          emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")
+                          + ": Caster response header too long"), true);
           return;
         }
@@ -307,6 +307,6 @@
         _socket = 0;
         _status = error;
-        emit newMessage(_url.path().toLatin1().replace(0,1,"")
-                        + ": Caster response header too long", true);
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")
+                        + ": Caster response header too long"), true);
         return;
       }
@@ -315,6 +315,6 @@
         _socket = 0;
         _status = error;
-        emit newMessage(_url.path().toLatin1().replace(0,1,"") 
-                        + ": Response timeout", true);
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 
+                        + ": Response timeout"), true);
         return;
       }
@@ -324,7 +324,7 @@
       _socket = 0;
       _status = error;
-      emit newMessage(_url.path().toLatin1().replace(0,1,"") 
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"") 
                       + ": Wrong caster response\n" 
-                      + response.join("").toLatin1(), true);
+                      + response.join("").toLatin1()), true);
     }
   }
Index: trunk/BNC/src/bncnetqueryv2.cpp
===================================================================
--- trunk/BNC/src/bncnetqueryv2.cpp	(revision 11184)
+++ trunk/BNC/src/bncnetqueryv2.cpp	(revision 11185)
@@ -43,5 +43,5 @@
   if (_secure ) {
     if (!QSslSocket::supportsSsl()) {
-      BNC_CORE->slotMessage("No SSL support, install OpenSSL run-time libraries", true);
+      BNC_CORE->message("No SSL support, install OpenSSL run-time libraries", true, "ntrip", t_logRecord::error);
       stop();
     }
@@ -80,13 +80,11 @@
     _status = error;
     if (!_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray().isEmpty()) {
-    emit newMessage(_url.path().toLatin1().replace(0,1,"")  +
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")  +
                     ": NetQueryV2: server replied: " +
-                    _reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray(),
-                    true);
+                    _reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray()), true);
     } else {
-      emit newMessage(_url.path().toLatin1().replace(0,1,"")  +
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")  +
                          ": NetQueryV2: server replied: " +
-                         _reply->errorString().toLatin1(),
-                         true);
+                         _reply->errorString().toLatin1()), true);
     }
   }
@@ -100,5 +98,5 @@
 void bncNetQueryV2::slotProxyAuthenticationRequired(const QNetworkProxy&,
                                                     QAuthenticator*) {
-  emit newMessage("slotProxyAuthenticationRequired", true);
+  emit newLogRecord(t_logRecord::message(t_logRecord::warning, "slotProxyAuthenticationRequired"), true);
 }
 
@@ -240,6 +238,6 @@
   if (timedOut) {
     _status = error;
-    emit newMessage(_url.path().toLatin1().replace(0,1,"")
-                    + ": Read timeout", true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, _url.path().toLatin1().replace(0,1,"")
+                    + ": Read timeout"), true);
     disconnect(_reply, SIGNAL(finished()), this, SLOT(slotFinished()));
     _reply->abort();
@@ -294,8 +292,8 @@
   if (_sslIgnoreErrors) {
     _reply->ignoreSslErrors();
-    BNC_CORE->slotMessage((msg + " (ignored as configured)").toLatin1(), true);
+    BNC_CORE->message((msg + " (ignored as configured)").toLatin1(), true, "ntrip", t_logRecord::warning);
   }
   else {
-    BNC_CORE->slotMessage(msg.toLatin1(), true);
+    BNC_CORE->message(msg.toLatin1(), true, "ntrip", t_logRecord::error);
     stop();
   }
Index: trunk/BNC/src/bncrawfile.cpp
===================================================================
--- trunk/BNC/src/bncrawfile.cpp	(revision 11184)
+++ trunk/BNC/src/bncrawfile.cpp	(revision 11185)
@@ -149,5 +149,5 @@
       int nBytes = lst.value(3).trimmed().toInt(&ok);
       if (!ok || nBytes < 0 || nBytes > (1 << 24)) {
-        BNC_CORE->slotMessage("Raw file: invalid chunk header: " + line.trimmed().left(80).toLatin1(), true);
+        BNC_CORE->message("Raw file: invalid chunk header: " + line.trimmed().left(80).toLatin1(), true, "stream", t_logRecord::warning);
         return data;
       }
Index: trunk/BNC/src/bncsettings.cpp
===================================================================
--- trunk/BNC/src/bncsettings.cpp	(revision 11184)
+++ trunk/BNC/src/bncsettings.cpp	(revision 11185)
@@ -80,4 +80,5 @@
         setValue_p("logFileStructured", "");
         setValue_p("logFormatStructured", "json");
+        setValue_p("logLevelStructured", "debug");
         setValue_p("rnxAppend", "0");
         setValue_p("onTheFlyInterval", "no");
Index: trunk/BNC/src/bncwindow.cpp
===================================================================
--- trunk/BNC/src/bncwindow.cpp	(revision 11184)
+++ trunk/BNC/src/bncwindow.cpp	(revision 11185)
@@ -207,4 +207,11 @@
     _logFormatStructuredComboBox->setCurrentIndex(kLogFmt);
   }
+  _logLevelStructuredComboBox = new QComboBox();
+  _logLevelStructuredComboBox->setEditable(false);
+  _logLevelStructuredComboBox->addItems(QString("debug,info,warning,error").split(","));
+  int kLogLev = _logLevelStructuredComboBox->findText(settings.value("logLevelStructured").toString());
+  if (kLogLev != -1) {
+    _logLevelStructuredComboBox->setCurrentIndex(kLogLev);
+  }
   _rawOutFileLineEdit = new QLineEdit(settings.value("rawOutFile").toString());
   _ephMountLineEdit = new QLineEdit(settings.value("ephMount").toString());
@@ -855,7 +862,9 @@
   gLayout->addWidget(_logFileLineEdit, 1, 1, 1, 20);
   gLayout->addWidget(new QLabel("Structured logfile"), 2, 0);
-  gLayout->addWidget(_logFileStructuredLineEdit, 2, 1, 1, 15);
-  gLayout->addWidget(new QLabel("  Format"), 2, 16, Qt::AlignRight);
-  gLayout->addWidget(_logFormatStructuredComboBox, 2, 17, 1, 4);
+  gLayout->addWidget(_logFileStructuredLineEdit, 2, 1, 1, 10);
+  gLayout->addWidget(new QLabel("  Format"), 2, 11, Qt::AlignRight);
+  gLayout->addWidget(_logFormatStructuredComboBox, 2, 12, 1, 3);
+  gLayout->addWidget(new QLabel("  Min. level"), 2, 15, Qt::AlignRight);
+  gLayout->addWidget(_logLevelStructuredComboBox, 2, 16, 1, 5);
   gLayout->addWidget(new QLabel("Append files"), 3, 0);
   gLayout->addWidget(_rnxAppendCheckBox, 3, 1);
@@ -1580,6 +1589,7 @@
   // ------------------
   _logFileLineEdit->setWhatsThis(tr("<p>Records of BNC's activities are shown in the 'Log' tab on the bottom of this window. They can be saved into a file when a valid path for that is specified in the 'Logfile (full path)' field.</p><p>The logfile name will automatically be extended by a string '_YYMMDD' carrying the current date. <i>[key: logFile]</i></p>"));
-  _logFileStructuredLineEdit->setWhatsThis(tr("<p>In addition to the logfile, BNC can write the same records as a structured logfile for log processing tools: one record per line, either JSON (JSON Lines) or logfmt (key=value pairs separated by blanks). Each record carries the time in UTC ('time', ISO 8601 with 'Z') and in GPS time ('gpst'), a level (info, warning, error), the component (e.g. stream, ppp), the event (e.g. ppp_position, stream_outage_begin), the station if known, the event's fields, the text of the classic logfile ('msg') and the record version ('v').</p><p>Messages without own event are written with component 'bnc' and event 'message'; their level is derived from keywords of the text. The logfile itself remains unchanged.</p><p>The file name will automatically be extended by a string '_YYMMDD' carrying the current date. Default is an empty option field, meaning that no structured logfile is written. <i>[key: logFileStructured]</i></p>"));
+  _logFileStructuredLineEdit->setWhatsThis(tr("<p>In addition to the logfile, BNC can write the same records as a structured logfile for log processing tools: one record per line, either JSON (JSON Lines) or logfmt (key=value pairs separated by blanks). Each record carries the time in UTC ('time', ISO 8601 with 'Z') and in GPS time ('gpst'), a level (debug, info, warning, error), the component (e.g. stream, ppp, cmb), the event (e.g. ppp_position, stream_outage_begin), the stream (mountpoint) or PPP station if known, the event's fields, the text of the classic logfile ('msg') and the record version ('v').</p><p>Messages without own event are written with event 'message' and the component of their origin; their level is error (a function does not work), warning (data or configuration problem, BNC continues) or info (status). The logfile itself remains unchanged.</p><p>The file name will automatically be extended by a string '_YYMMDD' carrying the current date. Default is an empty option field, meaning that no structured logfile is written. <i>[key: logFileStructured]</i></p>"));
   _logFormatStructuredComboBox->setWhatsThis(tr("<p>Select the format of the structured logfile: 'json' for one JSON object per line (JSON Lines), 'logfmt' for key=value pairs. Default is 'json'. <i>[key: logFormatStructured]</i></p>"));
+  _logLevelStructuredComboBox->setWhatsThis(tr("<p>Select the minimum level of the records written into the structured logfile: 'debug' writes all records (debug records exist only in BNC versions built with the BNC_DEBUG_* defines), 'info' leaves out the debug records, 'warning' writes warnings and errors only, 'error' errors only. The logfile is not affected. Default is 'debug'. <i>[key: logLevelStructured]</i></p>"));
   _rnxAppendCheckBox->setWhatsThis(tr("<p>When BNC is started, new files are created by default and file content already available under the same name will be overwritten. However, users might want to append already existing files following a regular restart or a crash of BNC or its platform.</p><p>Tick 'Append files' to continue with existing files and keep what has been recorded so far. <i>[key: rnxAppend]</i></p>"));
   _onTheFlyComboBox->setWhatsThis(tr("<p>When operating BNC online in 'no window' mode, some configuration parameters can be changed on-the-fly without interrupting the running process. For that BNC rereads parts of its configuration in pre-defined intervals. The default entry is 'no' that means the reread function is switched of. <p></p>Select '1 min', '5 min', '1 hour', or '1 day' to force BNC to reread its configuration every full minute, five minutes, hour, or day and let in between edited configuration options become effective on-the-fly without terminating uninvolved threads.</p><p>Note that when operating BNC in window mode, on-the-fly changeable configuration options become effective immediately via button 'Save & Reread Configuration'. <i>[key: onTheFlyInterval]</i></p>"));
@@ -1897,4 +1907,5 @@
   delete _logFileStructuredLineEdit;
   delete _logFormatStructuredComboBox;
+  delete _logLevelStructuredComboBox;
   delete _rawOutFileLineEdit;
   delete _ephMountLineEdit;
@@ -2432,4 +2443,5 @@
   settings.setValue("logFileStructured", _logFileStructuredLineEdit->text());
   settings.setValue("logFormatStructured", _logFormatStructuredComboBox->currentText());
+  settings.setValue("logLevelStructured", _logLevelStructuredComboBox->currentText());
   settings.setValue("rnxAppend", _rnxAppendCheckBox->checkState());
   settings.setValue("onTheFlyInterval", _onTheFlyComboBox->currentText());
@@ -2568,5 +2580,5 @@
 ////////////////////////////////////////////////////////////////////////////
 void bncWindow::slotGetThreadsFinished() {
-  BNC_CORE->slotMessage("All Get Threads Terminated", true);
+  BNC_CORE->message("All Get Threads Terminated", true, "bnc", t_logRecord::info);
   delete _caster;    _caster = 0; BNC_CORE->setCaster(0);
   delete _casterEph; _casterEph = 0;
@@ -2638,5 +2650,5 @@
   connect(_caster, SIGNAL(mountPointsRead(QList<bncGetThread*>)), this, SLOT(slotMountPointsRead(QList<bncGetThread*>)));
 
-  BNC_CORE->slotMessage("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true);
+  BNC_CORE->message("========== Start BNC v" BNCVERSION " (" BNC_OS ") ==========", true, "bnc", t_logRecord::info);
 
   bncSettings settings;
@@ -2645,45 +2657,45 @@
   // -------------
   if (!_rnxPathLineEdit->text().isEmpty())
-    BNC_CORE->slotMessage("Panel 'RINEX Observations' active", true);
+    BNC_CORE->message("Panel 'RINEX Observations' active", true, "bnc", t_logRecord::info);
   if (!_ephPathLineEdit->text().isEmpty())
-    BNC_CORE->slotMessage("Panel 'RINEX Ephemeris' active", true);
+    BNC_CORE->message("Panel 'RINEX Ephemeris' active", true, "bnc", t_logRecord::info);
   if (!_corrPathLineEdit->text().isEmpty())
-    BNC_CORE->slotMessage("Panel 'Broadcast Corrections' active", true);
+    BNC_CORE->message("Panel 'Broadcast Corrections' active", true, "bnc", t_logRecord::info);
   if (!_outPortLineEdit->text().isEmpty())
-    BNC_CORE->slotMessage("Panel 'Feed Engine' active", true);
+    BNC_CORE->message("Panel 'Feed Engine' active", true, "bnc", t_logRecord::info);
   if (!_serialMountPointLineEdit->text().isEmpty())
-    BNC_CORE->slotMessage("Panel 'Serial Output' active", true);
+    BNC_CORE->message("Panel 'Serial Output' active", true, "bnc", t_logRecord::info);
   if (!_adviseObsRateComboBox->currentText().isEmpty())
-    BNC_CORE->slotMessage("Panel 'Outages' active", true);
+    BNC_CORE->message("Panel 'Outages' active", true, "bnc", t_logRecord::info);
   if (!_miscMountLineEdit->text().isEmpty())
-    BNC_CORE->slotMessage("Panel 'Miscellaneous' active", true);
+    BNC_CORE->message("Panel 'Miscellaneous' active", true, "bnc", t_logRecord::info);
   if (_pppWidgets._dataSource->currentText() == "Real-Time Streams")
-    BNC_CORE->slotMessage("Panel 'PPP' active", true);
+    BNC_CORE->message("Panel 'PPP' active", true, "bnc", t_logRecord::info);
   if (_cmbTable->rowCount() > 0)
-    BNC_CORE->slotMessage("Panel 'Combine Corrections' active", true);
+    BNC_CORE->message("Panel 'Combine Corrections' active", true, "bnc", t_logRecord::info);
   if (_uploadTable->rowCount() > 0)
-    BNC_CORE->slotMessage("Panel 'Upload Corrections' active", true);
+    BNC_CORE->message("Panel 'Upload Corrections' active", true, "bnc", t_logRecord::info);
   if (_uploadEphTable->rowCount() > 0)
-    BNC_CORE->slotMessage("Panel 'UploadEphemeris' active", true);
+    BNC_CORE->message("Panel 'UploadEphemeris' active", true, "bnc", t_logRecord::info);
 
   QDir rnxdir(settings.value("rnxPath").toString());
-  if (!rnxdir.exists()) BNC_CORE->slotMessage("Cannot find RINEX Observations directory", true);
+  if (!rnxdir.exists()) BNC_CORE->message("Cannot find RINEX Observations directory", true, "bnc", t_logRecord::error);
 
   QString rnx_file = settings.value("rnxScript").toString();
   if (!rnx_file.isEmpty()) {
     QFile rnxfile(settings.value("rnxScript").toString());
-    if (!rnxfile.exists()) BNC_CORE->slotMessage("Cannot find RINEX Observations script", true);
+    if (!rnxfile.exists()) BNC_CORE->message("Cannot find RINEX Observations script", true, "bnc", t_logRecord::error);
   }
 
   QDir ephdir(settings.value("ephPath").toString());
-  if (!ephdir.exists()) BNC_CORE->slotMessage("Cannot find RINEX Ephemeris directory", true);
+  if (!ephdir.exists()) BNC_CORE->message("Cannot find RINEX Ephemeris directory", true, "bnc", t_logRecord::error);
 
   QDir corrdir(settings.value("corrPath").toString());
-  if (!corrdir.exists()) BNC_CORE->slotMessage("Cannot find Broadcast Corrections directory", true);
+  if (!corrdir.exists()) BNC_CORE->message("Cannot find Broadcast Corrections directory", true, "bnc", t_logRecord::error);
 
   QString advise_file = settings.value("adviseScript").toString();
   if (!advise_file.isEmpty()) {
     QFile advisefile(settings.value("adviseScript").toString());
-    if (!advisefile.exists()) BNC_CORE->slotMessage("Cannot find Outages script", true);
+    if (!advisefile.exists()) BNC_CORE->message("Cannot find Outages script", true, "bnc", t_logRecord::error);
   }
 
Index: trunk/BNC/src/bncwindow.h
===================================================================
--- trunk/BNC/src/bncwindow.h	(revision 11184)
+++ trunk/BNC/src/bncwindow.h	(revision 11185)
@@ -186,4 +186,5 @@
     QLineEdit* _logFileStructuredLineEdit;
     QComboBox* _logFormatStructuredComboBox;
+    QComboBox* _logLevelStructuredComboBox;
     QLineEdit* _rawOutFileLineEdit;
     QLineEdit* _ephMountLineEdit;
Index: trunk/BNC/src/combination/bnccomb.cpp
===================================================================
--- trunk/BNC/src/combination/bnccomb.cpp	(revision 11184)
+++ trunk/BNC/src/combination/bnccomb.cpp	(revision 11185)
@@ -209,12 +209,13 @@
   _rtnetDecoder = new bncRtnetDecoder();
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)), BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
+  BNC_CORE->connectMessages(this, "cmb");
+  BNC_CORE->connectLogRecords(this, "cmb");
 
   // Reference signals of the clocks
   for (const QString& err : t_ssrRefSig::init()) {
-    emit newMessage(("bncComb: " + err).toLatin1(), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, ("bncComb: " + err).toLatin1()), true);
   }
   if (!t_ssrRefSig::allDefault()) {
-    emit newMessage(("bncComb: reference signals of the clocks " + t_ssrRefSig::currentString()).toLatin1(), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, ("bncComb: reference signals of the clocks " + t_ssrRefSig::currentString()).toLatin1()), true);
   }
 
@@ -278,10 +279,10 @@
     _antex = new bncAntex();
     if (_antex->readFile(antexFileName) != success) {
-      emit newMessage("bncComb: wrong ANTEX file", true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: wrong ANTEX file"), true);
       delete _antex;
       _antex = 0;
     }
     else {
-      emit newMessage("bncComb: " + _antex->info().toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: " + _antex->info().toLatin1()), true);
     }
   }
@@ -302,14 +303,14 @@
       it.value() = false;
     }
-    emit newMessage("bncComb: APC and CoM streams configured - combination in the CoM frame, "
-                    "orbits of the APC streams converted to CoM", true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: APC and CoM streams configured - combination in the CoM frame, "
+                    "orbits of the APC streams converted to CoM"), true);
   }
   else if (hasAPC && hasCoM) {
-    emit newMessage("bncComb: APC and CoM streams configured, but no ANTEX file - only the streams "
-                    "with the reference point of the master AC are combined", true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: APC and CoM streams configured, but no ANTEX file - only the streams "
+                    "with the reference point of the master AC are combined"), true);
   }
   if (!_antex && hasCoM) {
-    emit newMessage("bncComb: CoM streams configured, but no ANTEX file - the combined orbits (INTERNAL) "
-                    "may refer to the CoM, while the PPP assumes the APC", true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: CoM streams configured, but no ANTEX file - the combined orbits (INTERNAL) "
+                    "may refer to the CoM, while the PPP assumes the APC"), true);
   }
 
@@ -322,5 +323,5 @@
     _bsx = new bncBiasSnx();
     if (_bsx->readFile(bsxFileName) != success) {
-      emit newMessage("bncComb: wrong Bias SINEX file", true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: wrong Bias SINEX file"), true);
       delete _bsx;
       _bsx = 0;
@@ -418,5 +419,5 @@
 
   if (bsxFileName.isEmpty()) {
-    emit newMessage("bncComb: no Bias SINEX file specified", true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: no Bias SINEX file specified"), true);
     return;
   }
@@ -425,10 +426,10 @@
   }
   if (_bsx->readFile(bsxFileName) != success) {
-    emit newMessage("bncComb: wrong Bias SINEX file", true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: wrong Bias SINEX file"), true);
     delete _bsx;
     _bsx = 0;
   }
   else {
-    emit newMessage("bncComb: successfully read Bias SINEX file", true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: successfully read Bias SINEX file"), true);
   }
 
@@ -638,8 +639,8 @@
       if (!warned.valid() || newClk._time - warned >= 3600.0) {
         warned = newClk._time;
-        emit newMessage("bncComb: " + acName.toLatin1() + " " + QByteArray(1, sys) + " not combined: its orbits refer to the " +
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + acName.toLatin1() + " " + QByteArray(1, sys) + " not combined: its orbits refer to the " +
                         (isAPC ? "APC" : "CoM") + ", those of the master AC " + _masterOrbitAC[sys].toLatin1() +
                         " to the " + (isAPC ? "CoM" : "APC") +
-                        " (an ANTEX file allows to combine both in the CoM frame)", true);
+                        " (an ANTEX file allows to combine both in the CoM frame)"), true);
       }
       continue;
@@ -651,7 +652,7 @@
       if (fabs(currentTime - newClk._time) > 60.0) { // future or very old data sets
   #ifdef BNC_DEBUG_CMB
-        emit newMessage("bncComb: future or very old data sets: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() +
+        emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: future or very old data sets: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() +
             QString(" %1 ").arg(newClk._time.timestr().c_str()).toLatin1() + "vs. current time" +
-            QString(" %1 ").arg(currentTime.timestr().c_str()).toLatin1(), true);
+            QString(" %1 ").arg(currentTime.timestr().c_str()).toLatin1()), true);
   #endif
         continue;
@@ -663,7 +664,7 @@
     if (_resTime.valid() && newClk._time <= _resTime) {
 #ifdef BNC_DEBUG_CMB
-      emit newMessage("bncComb: old correction: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() +
+      emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: old correction: " + acName.toLatin1() + " " + newClk._prn.toString().c_str() +
           QString(" %1 ").arg(newClk._time.timestr().c_str()).toLatin1() + "vs. last processing Epoch" +
-          QString(" %1 ").arg(_resTime.timestr().c_str()).toLatin1(), true);
+          QString(" %1 ").arg(_resTime.timestr().c_str()).toLatin1()), true);
 #endif
       continue;
@@ -780,5 +781,5 @@
     + QString(" %1 -> %2 %3").arg(corr->_iod,3).arg(lastEph->IOD(),3).arg(dC*t_CST::c, 8, 'f', 4);
 
-  emit newMessage(msg.toLatin1(), false);
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, msg.toLatin1()), false);
 
   corr->_iod = lastEph->IOD();
@@ -800,5 +801,5 @@
     QString msg = _antexReloader.update(_antex, epoTime);
     if (!msg.isEmpty()) {
-      emit newMessage(("bncComb: " + msg).toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::info, ("bncComb: " + msg).toLatin1()), true);
     }
   }
@@ -860,5 +861,5 @@
     if (ephLast == 0) {
 #ifdef BNC_DEBUG_CMB
-      emit newMessage("bncComb: eph not found for "  + prnStr.mid(0,3).toLatin1(), true);
+      emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: eph not found for "  + prnStr.mid(0,3).toLatin1()), true);
 #endif
       delete _newCorr; _newCorr = 0;
@@ -870,5 +871,5 @@
              ephLast->checkState() == t_eph::unhealthy) {
 #ifdef BNC_DEBUG_CMB
-      emit newMessage("bncComb: ephLast not ok (checkState: " +  ephLast->checkStateToString().toLatin1() + ") for "  + prnStr.mid(0,3).toLatin1(), true);
+      emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: ephLast not ok (checkState: " +  ephLast->checkStateToString().toLatin1() + ") for "  + prnStr.mid(0,3).toLatin1()), true);
 #endif
       delete _newCorr; _newCorr = 0;
@@ -888,6 +889,6 @@
       else {
 #ifdef BNC_DEBUG_CMB
-        emit newMessage("bncComb: eph not found for "  + prnStr.mid(0,3).toLatin1() +
-                        QString(" with IOD %1").arg(_newCorr->_iod).toLatin1(), true);
+        emit newLogRecord(t_logRecord::debugMessage("cmb", "bncComb: eph not found for "  + prnStr.mid(0,3).toLatin1() +
+                        QString(" with IOD %1").arg(_newCorr->_iod).toLatin1()), true);
 #endif
         delete _newCorr; _newCorr = 0;
@@ -955,9 +956,9 @@
           }
         }
-        emit newMessage("bncComb: " + acName.toLatin1() + " provides no code biases for the " +
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + acName.toLatin1() + " provides no code biases for the " +
                         QByteArray(1, sys) + " reference signal(s)" + missing.toLatin1() +
                         " (e.g. " + prnStr.mid(0,3).toLatin1() + ") - these clocks are combined"
                         " without referring them to the reference signals and, as long as other ACs"
-                        " provide referred clocks, excluded from the clock datum", false);
+                        " provide referred clocks, excluded from the clock datum"), false);
       }
     }
@@ -1112,5 +1113,5 @@
       out << "Missing Master, Epoch skipped" << "\n";
       _buffer.remove(sys);
-      emit newMessage(_log, false);
+      emit newLogRecord(t_logRecord::message(t_logRecord::info, _log), false);
       return;
     }
@@ -1411,5 +1412,5 @@
         out << epoTime.datestr().c_str() << " " << epoTime.timestr().c_str()
             << " " << msg << "\n";
-        emit newMessage("bncComb: " + msg.toLatin1(), true);
+        emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncComb: " + msg.toLatin1()), true);
         resetSatOffsets(sys);
       }
@@ -1440,5 +1441,5 @@
     if (!warned.valid() || epoTime - warned >= 3600.0) {
       warned = epoTime;
-      emit newMessage("bncComb: " + msg.toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + msg.toLatin1()), true);
     }
   }
@@ -1471,8 +1472,8 @@
                                &corr->_attYaw) != success) {
     if (_antex->warnNoSatEntry(corr->_prn, corr->_time)) {
-      emit newMessage("bncComb: no satellite antenna entry valid at " +
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: no satellite antenna entry valid at " +
                       QByteArray(corr->_time.datestr().c_str()) + " " + QByteArray(corr->_time.timestr().c_str()) +
                       " for " + corr->_prn.mid(0,3).toLatin1() +
-                      " in ANTEX file - APC orbit of " + AC->name.toLatin1() + " not converted to CoM, not combined", true);
+                      " in ANTEX file - APC orbit of " + AC->name.toLatin1() + " not converted to CoM, not combined"), true);
     }
     return failure;
@@ -1549,5 +1550,5 @@
                   .arg(stat.numEpo).arg(median, 0, 'f', 2);
     out << epoTime.datestr().c_str() << " " << epoTime.timestr().c_str() << " " << msg << "\n";
-    emit newMessage("bncComb: " + msg.toLatin1(), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + msg.toLatin1()), true);
   }
   _outlierStat[sys].clear();
@@ -1634,7 +1635,7 @@
       double age = epoTime - corr->_eph->TOC();
       if (fabs(age) > 960.0) {
-        emit newMessage(QString().asprintf(
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString().asprintf(
           "bncComb: skip %s, GLONASS eph age %.0fs",
-          corr->_prn.mid(0,3).toLatin1().data(), age).toLatin1(), false);
+          corr->_prn.mid(0,3).toLatin1().data(), age).toLatin1()), false);
         delete corr;
         it.remove();
@@ -1700,8 +1701,8 @@
         // converted between antenna phase center and center of mass
         if (_antex->warnNoSatEntry(corr->_prn, epoTime)) {
-          emit newMessage("bncComb: no satellite antenna entry valid at " +
+          emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: no satellite antenna entry valid at " +
                           QByteArray(epoTime.datestr().c_str()) + " " + QByteArray(epoTime.timestr().c_str()) +
                           " for " + corr->_prn.mid(0,3).toLatin1() +
-                          " in ANTEX file - ANTEX file outdated? Satellite not combined", true);
+                          " in ANTEX file - ANTEX file outdated? Satellite not combined"), true);
         }
         orbCorrections.pop_back();
@@ -1717,5 +1718,5 @@
       for (const QString& line : yawLogs) {
         if (!line.contains(":att:")) {
-          emit newMessage(("bncComb: " + line.trimmed()).toLatin1(), false);
+          emit newLogRecord(t_logRecord::message(t_logRecord::info, ("bncComb: " + line.trimmed()).toLatin1()), false);
         }
       }
@@ -2318,5 +2319,5 @@
     if (!warned.valid() || epoTime - warned >= 3600.0) {
       warned = epoTime;
-      emit newMessage("bncComb: " + QByteArray(1, sys) + " " + msg.toLatin1(), false);
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncComb: " + QByteArray(1, sys) + " " + msg.toLatin1()), false);
     }
   }
Index: trunk/BNC/src/combination/bnccomb.h
===================================================================
--- trunk/BNC/src/combination/bnccomb.h	(revision 11184)
+++ trunk/BNC/src/combination/bnccomb.h	(revision 11185)
@@ -16,4 +16,5 @@
 #include "bncephuser.h"
 #include "satObs.h"
+#include "bnclog.h"
 #include "bncconst.h"
 #include "bncoutf.h"
@@ -54,4 +55,5 @@
  signals:
   void newMessage(QByteArray msg, bool showOnScreen);
+  void newLogRecord(t_logRecord rec, bool showOnScreen);
   void newOrbCorrections(QList<t_orbCorr>);
   void newClkCorrections(QList<t_clkCorr>);
Index: trunk/BNC/src/latencychecker.cpp
===================================================================
--- trunk/BNC/src/latencychecker.cpp	(revision 11184)
+++ trunk/BNC/src/latencychecker.cpp	(revision 11185)
@@ -60,8 +60,6 @@
   _curLat = 0.0;
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)),
-          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
-  connect(this, SIGNAL(newLogRecord(t_logRecord,bool)),
-          BNC_CORE, SLOT(slotLogRecord(t_logRecord,bool)));
+  BNC_CORE->connectMessages(this, "stream");
+  BNC_CORE->connectLogRecords(this, "stream");
 
   bncSettings settings;
Index: trunk/BNC/src/pppMain.cpp
===================================================================
--- trunk/BNC/src/pppMain.cpp	(revision 11184)
+++ trunk/BNC/src/pppMain.cpp	(revision 11185)
@@ -93,5 +93,5 @@
   }
   catch (t_except exc) {
-    BNC_CORE->slotMessage(QByteArray::fromStdString(exc.what()), true);
+    BNC_CORE->message(QByteArray::fromStdString(exc.what()), true, "ppp", t_logRecord::error);
     _running = true;
     stop();
Index: trunk/BNC/src/pppRun.cpp
===================================================================
--- trunk/BNC/src/pppRun.cpp	(revision 11184)
+++ trunk/BNC/src/pppRun.cpp	(revision 11185)
@@ -68,9 +68,7 @@
   _opt = opt;
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)),
-          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
-  connect(this, SIGNAL(newLogRecord(t_logRecord,bool)),
-          BNC_CORE, SLOT(slotLogRecord(t_logRecord,bool)));
-  t_logRecord::registerStation(QByteArray(_opt->_roverName.c_str()));
+  BNC_CORE->connectMessages(this, "ppp");
+  BNC_CORE->connectLogRecords(this, "ppp");
+  t_logRecord::registerStream(QByteArray(_opt->_roverName.c_str()));
 
   connect(this,     SIGNAL(newPosition(QByteArray, bncTime, QVector<double>)),
@@ -88,6 +86,6 @@
                                                                 Qt::SkipEmptyParts);
     if (!_ephMounts.isEmpty()) {
-      emit newMessage(QByteArray(_opt->_roverName.c_str()) + ": PPP uses the ephemerides of "
-                      + _ephMounts.join(", ").toLatin1() + " only", true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::info, QByteArray(_opt->_roverName.c_str()) + ": PPP uses the ephemerides of "
+                      + _ephMounts.join(", ").toLatin1() + " only"), true);
     }
 
@@ -748,13 +746,13 @@
         }
         catch (const char* msg) {
-          emit newMessage(QByteArray(msg), true);
+          emit newLogRecord(t_logRecord::message(t_logRecord::error, QByteArray(msg)), true);
           break;
         }
         catch (const string& msg) {
-          emit newMessage(QByteArray(msg.c_str()), true);
+          emit newLogRecord(t_logRecord::message(t_logRecord::error, QByteArray(msg.c_str())), true);
           break;
         }
         catch (...) {
-          emit newMessage("unknown exceptions in file " + file->name().toLatin1(), true);
+          emit newLogRecord(t_logRecord::message(t_logRecord::error, "unknown exceptions in file " + file->name().toLatin1()), true);
           break;
         }
@@ -888,5 +886,5 @@
 
   QString msg = "pppRun " + QString(_opt->_roverName.c_str()) + ": SSR Provider or Service changed: " + mountPoint;
-  emit newMessage(msg.toLatin1(), true);
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, msg.toLatin1()), true);
 
   _pppClient->reset();
Index: trunk/BNC/src/pppThread.cpp
===================================================================
--- trunk/BNC/src/pppThread.cpp	(revision 11184)
+++ trunk/BNC/src/pppThread.cpp	(revision 11185)
@@ -62,6 +62,6 @@
   connect(this, SIGNAL(finished()), this, SLOT(deleteLater()));
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)),
-          BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
+  BNC_CORE->connectMessages(this, "ppp");
+  BNC_CORE->connectLogRecords(this, "ppp");
 }
 
@@ -89,5 +89,5 @@
     _pppRun = 0;
     _ready.release();
-    emit newMessage(QByteArray(exc.what().c_str()), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::error, QByteArray(exc.what().c_str())), true);
   }
 }
Index: trunk/BNC/src/pppThread.h
===================================================================
--- trunk/BNC/src/pppThread.h	(revision 11184)
+++ trunk/BNC/src/pppThread.h	(revision 11185)
@@ -6,4 +6,5 @@
 #include <QtCore>
 
+#include "bnclog.h"
 #include "pppOptions.h"
 #include "pppClient.h"
@@ -24,4 +25,5 @@
  signals:
   void newMessage(QByteArray msg, bool showOnScreen);
+  void newLogRecord(t_logRecord rec, bool showOnScreen);
 
  private:
Index: trunk/BNC/src/ssrQc.cpp
===================================================================
--- trunk/BNC/src/ssrQc.cpp	(revision 11184)
+++ trunk/BNC/src/ssrQc.cpp	(revision 11185)
@@ -145,7 +145,8 @@
   }
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)), BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
+  BNC_CORE->connectMessages(this, "ssrqc");
+  BNC_CORE->connectLogRecords(this, "ssrqc");
   for (const QString& err : t_ssrRefSig::init()) {
-    emit newMessage(("SSR QC: " + err).toLatin1(), true);
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, ("SSR QC: " + err).toLatin1()), true);
   }
   // reference code biases from a Bias SINEX file (optional)
@@ -160,5 +161,5 @@
     }
     else {
-      emit newMessage(("SSR QC: wrong Bias SINEX file " + bsxFile).toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, ("SSR QC: wrong Bias SINEX file " + bsxFile).toLatin1()), true);
       delete _bsxRef;
       _bsxRef = 0;
@@ -171,5 +172,5 @@
     _antex = new bncAntex();
     if (_antex->readFile(antexFile) != success || _antex->numSatPrns() == 0) {
-      emit newMessage(("SSR QC: wrong ANTEX file " + antexFile + " - no attitude check").toLatin1(), true);
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, ("SSR QC: wrong ANTEX file " + antexFile + " - no attitude check").toLatin1()), true);
       delete _antex;
       _antex = 0;
@@ -1758,8 +1759,8 @@
   }
 
-  emit newMessage(QString("SSR QC: report %1 %2 of %3 stream(s) written to %4")
+  emit newLogRecord(t_logRecord::message(t_logRecord::info, QString("SSR QC: report %1 %2 of %3 stream(s) written to %4")
                   .arg(QString::fromStdString(_intervalStart.datestr()))
                   .arg(QString::fromStdString(_intervalStart.timestr(0)))
-                  .arg(streams.size()).arg(_dirName).toLatin1(), false);
+                  .arg(streams.size()).arg(_dirName).toLatin1()), false);
 
   _cmpStat.clear();
Index: trunk/BNC/src/ssrQc.h
===================================================================
--- trunk/BNC/src/ssrQc.h	(revision 11184)
+++ trunk/BNC/src/ssrQc.h	(revision 11185)
@@ -4,4 +4,5 @@
 #include <QtCore>
 #include <fstream>
+#include "bnclog.h"
 #include "bncephuser.h"
 #include "bnctime.h"
@@ -35,4 +36,5 @@
  signals:
   void newMessage(QByteArray msg, bool showOnScreen);
+  void newLogRecord(t_logRecord rec, bool showOnScreen);
 
  private:
Index: trunk/BNC/src/upload/bncrtnetuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 11184)
+++ trunk/BNC/src/upload/bncrtnetuploadcaster.cpp	(revision 11185)
@@ -330,6 +330,5 @@
 
     if (lines.size() < 2) {
-        emit(newMessage(
-            "bncRtnetUploadCaster: less than 2 lines to decode " + _casterID.toLatin1(), false));
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, "bncRtnetUploadCaster: less than 2 lines to decode " + _casterID.toLatin1()), false);
         return;
     }
@@ -354,8 +353,7 @@
     epoTime.set(year, month, day, hour, min, sec);
 
-    emit(newMessage(
-        "bncRtnetUploadCaster: decode " + QByteArray(epoTime.datestr().c_str())
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, "bncRtnetUploadCaster: decode " + QByteArray(epoTime.datestr().c_str())
         + " " + QByteArray(epoTime.timestr().c_str()) + " "
-        + _casterID.toLatin1(), false));
+        + _casterID.toLatin1()), false);
 
     struct SsrCorr::ClockOrbit co;
@@ -697,6 +695,6 @@
                         in >> dummy;
                     }
-                    emit(newMessage("                      RTNET format error: "
-                        + lines[ii].toLatin1(), false));
+                    emit newLogRecord(t_logRecord::message(t_logRecord::error, "                      RTNET format error: "
+                        + lines[ii].toLatin1()), false);
                     break;
                 }
@@ -1180,5 +1178,5 @@
 
         if (corrIsOutOfRange(sd)) {
-            emit(newMessage(QString("bncRtnetUploadCaster: SSR parameter is out of its defined range").toLatin1(), false));
+            emit newLogRecord(t_logRecord::message(t_logRecord::warning, QString("bncRtnetUploadCaster: SSR parameter is out of its defined range").toLatin1()), false);
             return failure;
         }
Index: trunk/BNC/src/upload/bncuploadcaster.cpp
===================================================================
--- trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 11184)
+++ trunk/BNC/src/upload/bncuploadcaster.cpp	(revision 11185)
@@ -63,5 +63,6 @@
   _isToBeDeleted = false;
 
-  connect(this, SIGNAL(newMessage(QByteArray,bool)), BNC_CORE, SLOT(slotMessage(const QByteArray,bool)));
+  BNC_CORE->connectMessages(this, "upload");
+  BNC_CORE->connectLogRecords(this, "upload");
 
   if (BNC_CORE->_uploadTableItems.find(_iRow) != BNC_CORE->_uploadTableItems.end()) {
@@ -95,6 +96,6 @@
       // no fallback to Ntrip Version 2: user name and password would be sent
       // unencrypted although an encrypted connection was configured
-      emit(newMessage(_mountpoint.toLatin1() + "@" + _casterOutHost.toLatin1() +
-          ": No SSL support, please install OpenSSL run-time libraries: no upload", true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::error, _mountpoint.toLatin1() + "@" + _casterOutHost.toLatin1() +
+          ": No SSL support, please install OpenSSL run-time libraries: no upload"), true);
     } else {
       _secure = true;
@@ -137,5 +138,5 @@
 void bncUploadCaster::slotProxyAuthenticationRequired(const QNetworkProxy&,
     QAuthenticator*) {
-  emit newMessage("slotProxyAuthenticationRequired", true);
+  emit newLogRecord(t_logRecord::message(t_logRecord::warning, "slotProxyAuthenticationRequired"), true);
 }
 
@@ -171,5 +172,5 @@
       msg += " (ignored as configured)";
     }
-    emit(newMessage(_mountpoint.toLatin1() + "@" + _casterOutHost.toLatin1() + ": " + msg.toLatin1(), true));
+    emit newLogRecord(t_logRecord::message((_sslIgnoreErrors ? t_logRecord::warning : t_logRecord::error), _mountpoint.toLatin1() + "@" + _casterOutHost.toLatin1() + ": " + msg.toLatin1()), true);
   }
 }
@@ -274,5 +275,5 @@
   } else {
     if (_ntripVersion == "1") {
-      emit(newMessage("No proxy support in Ntrip Version 1 upload!", true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, "No proxy support in Ntrip Version 1 upload!"), true);
       delete _outSocket; _outSocket = 0;
       return;
@@ -299,24 +300,24 @@
       if (!statusOk(ans)) {
         int l = ans.indexOf("\r\n", 0);
-        emit(newMessage("Proxy: Connection broken for " + _mountpoint.toLatin1() + "@" +
-            _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()  + ": "  + ans.left(l), true));
+        emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Proxy: Connection broken for " + _mountpoint.toLatin1() + "@" +
+            _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()  + ": "  + ans.left(l)), true);
         delete _outSocket; _outSocket = 0;
         return;
       } else {
-        emit(newMessage("Proxy: Connection established for " + _mountpoint.toLatin1()+ "@" +
-            _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() , true));
+        emit newLogRecord(t_logRecord::message(t_logRecord::info, "Proxy: Connection established for " + _mountpoint.toLatin1()+ "@" +
+            _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()), true);
         _sOpenTrial = 0;
         _outSocket->setPeerVerifyName(_casterOutHost);
         _outSocket->startClientEncryption();
         if (!_outSocket->waitForEncrypted(timeOut)) {
-          emit(newMessage("Proxy/Caster: Encrypt timeout for " + _mountpoint.toLatin1() + "@"
+          emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Proxy/Caster: Encrypt timeout for " + _mountpoint.toLatin1() + "@"
                           + _casterOutHost.toLatin1() + ":"
                           + QString("%1) ").arg(_casterOutPort).toLatin1()
-                          + _outSocket->errorString().toLatin1(), true));
+                          + _outSocket->errorString().toLatin1()), true);
           delete _outSocket; _outSocket = 0;
           return;
         } else {
-          emit(newMessage("Proxy: SSL handshake completed for " + _mountpoint.toLatin1() + "@" +
-              _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1(), true));
+          emit newLogRecord(t_logRecord::message(t_logRecord::info, "Proxy: SSL handshake completed for " + _mountpoint.toLatin1() + "@" +
+              _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()), true);
         }
       }
@@ -347,10 +348,10 @@
     delete _outSocket; _outSocket = 0;
     int l = ans.indexOf("\r\n", 0);
-    emit(newMessage("Broadcaster: Connection broken for " + _mountpoint.toLatin1() + "@" +
+    emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Broadcaster: Connection broken for " + _mountpoint.toLatin1() + "@" +
          _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() +
-         ": " + ans.left(l), true));
-  } else {
-    emit(newMessage("Broadcaster: Connection opened for " + _mountpoint.toLatin1() + "@" +
-        _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1() , true));
+         ": " + ans.left(l)), true);
+  } else {
+    emit newLogRecord(t_logRecord::message(t_logRecord::info, "Broadcaster: Connection opened for " + _mountpoint.toLatin1() + "@" +
+        _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()), true);
     _sOpenTrial = 0;
   }
@@ -364,22 +365,21 @@
     _outSocket->connectToHostEncrypted(outHost, outPort);
     if (!_outSocket->waitForEncrypted(timeOut)) {
-      emit(newMessage(
-           "Broadcaster: Connect timeout for " + _mountpoint.toLatin1() + "@"
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Broadcaster: Connect timeout for " + _mountpoint.toLatin1() + "@"
               + outHost.toLatin1() + ":"
               + QString("%1) ").arg(outPort).toLatin1()
-              + _outSocket->errorString().toLatin1(), true));
+              + _outSocket->errorString().toLatin1()), true);
       delete _outSocket; _outSocket = 0;
       return false;
     } else {
-      emit(newMessage("Broadcaster: SSL handshake completed for " + _mountpoint.toLatin1() + "@" +
-          _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1(), true));
+      emit newLogRecord(t_logRecord::message(t_logRecord::info, "Broadcaster: SSL handshake completed for " + _mountpoint.toLatin1() + "@" +
+          _casterOutHost.toLatin1() + ":" + QString("%1").arg(_casterOutPort).toLatin1()), true);
     }
   } else {
     _outSocket->connectToHost(outHost, outPort);
     if (!_outSocket->waitForConnected(timeOut)) {
-      emit(newMessage("Broadcaster: Connect timeout for " + _mountpoint.toLatin1() + "@"
+      emit newLogRecord(t_logRecord::message(t_logRecord::warning, "Broadcaster: Connect timeout for " + _mountpoint.toLatin1() + "@"
               + outHost.toLatin1() + ":"
               + QString("%1) ").arg(outPort).toLatin1()
-              + _outSocket->errorString().toLatin1(), true));
+              + _outSocket->errorString().toLatin1()), true);
       delete _outSocket; _outSocket = 0;
       return false;
Index: trunk/BNC/src/upload/bncuploadcaster.h
===================================================================
--- trunk/BNC/src/upload/bncuploadcaster.h	(revision 11184)
+++ trunk/BNC/src/upload/bncuploadcaster.h	(revision 11185)
@@ -10,4 +10,5 @@
 #include <QSslKey>
 #include <iostream>
+#include "bnclog.h"
 
 
@@ -39,4 +40,5 @@
  signals:
   void newMessage(const QByteArray msg, bool showOnScreen);
+  void newLogRecord(t_logRecord rec, bool showOnScreen);
   void newBytes(QByteArray staID, double nbyte);
 
Index: trunk/BNC/tests/cases/log_structured/case.json
===================================================================
--- trunk/BNC/tests/cases/log_structured/case.json	(revision 11184)
+++ trunk/BNC/tests/cases/log_structured/case.json	(revision 11185)
@@ -1,4 +1,4 @@
 {
-  "description": "Structured logfile next to the classic one: 10_PPPQuickStart replay, JSON (main run) and logfmt (lf), checked by logcheck.py against each other and the classic log, 11 min",
+  "description": "Structured logfile next to the classic one: 10_PPPQuickStart replay with RTCM scan, JSON (main run) and logfmt (lf), checked by logcheck.py against each other and the classic log, 11 min",
   "config": "Example_Configs/10_PPPQuickStart.bnc",
   "raw": "data/wtzr_cnes_11min.raw",
@@ -10,4 +10,6 @@
     "WTZR00DEU0,0.02,0.02,0.05,100.0,100.0,100.0,0.1,3e-6,0,G:1&WCP G:2&WSL R:12&CP E:1&C E:5&Q C:26&I,",
     "-key", "logFileStructured", "Output/PPPQuickStart.jsonl",
+    "-key", "miscMount", "ALL",
+    "-key", "miscScanRTCM", "2",
     "-key", "logFormatStructured", "json"
   ],
@@ -18,4 +20,6 @@
                      "WTZR00DEU0,0.02,0.02,0.05,100.0,100.0,100.0,0.1,3e-6,0,G:1&WCP G:2&WSL R:12&CP E:1&C E:5&Q C:26&I,",
                      "-key", "logFileStructured", "Output/PPPQuickStart.logfmt",
+                     "-key", "miscMount", "ALL",
+                     "-key", "miscScanRTCM", "2",
                      "-key", "logFormatStructured", "logfmt"]},
            {"dir": "chk", "tool": ["logcheck.py", "Output/PPPQuickStart.log_251117",
