]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Use 'ts', not 'tm', for the timestamp in structured-like log messages
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 21 Nov 2023 16:16:53 +0000 (17:16 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 21 Nov 2023 16:16:53 +0000 (17:16 +0100)
pdns/dnsdistdist/docs/reference/config.rst
pdns/dnsdistdist/dolog.cc

index efe3d9d551799ffff1e4af83ddf230dc71c0b7d5..44e7d8dd937af754eedf5618ccb20b89c9d49dfc 100644 (file)
@@ -1210,11 +1210,11 @@ Status, Statistics and More
   Set whether log messages should be in a structured-logging-like format. This is turned off by default.
   The resulting format looks like this (when timestamps are enabled via ``--log-timestamps`` and with ``levelPrefix="prio"`` and ``timeFormat="ISO8601"``)::
 
-  tm="2023-11-06T12:04:58+0100" prio="info" msg="Added downstream server 127.0.0.1:53"
+  ts="2023-11-06T12:04:58+0100" prio="Info" msg="Added downstream server 127.0.0.1:53"
 
   And with ``levelPrefix="level"`` and ``timeFormat="numeric"``)::
 
-  tm="1699268815.133" level="info" msg="Added downstream server 127.0.0.1:53"
+  ts="1699268815.133" level="Info" msg="Added downstream server 127.0.0.1:53"
 
   :param bool enable: Set to true if you want to enable structured logging
   :param table options: A table with key: value pairs with options described below.
index 0222e14b569d48f35d4582fe42e1112374ffe971..318145b73213b79ad3f71f58bd0c00bfa4f2f3f8 100644 (file)
@@ -86,7 +86,7 @@ void logTime(std::ostream& stream)
   }
 
   if (dnsdist::logging::LoggingConfiguration::getStructuredLogging()) {
-    stream << "tm=\"" << buffer.data() << "\" ";
+    stream << "ts=" << std::quoted(buffer.data()) << " ";
   }
   else {
     stream << buffer.data();