From 174550e1bf23c859c7930bbd145399e6fad46f1e Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 7 Nov 2024 13:28:10 +0330 Subject: [PATCH 01/21] Added "date_time_utc" Signed-off-by: xogoodnow --- .../settings.md | 1 + src/Loggers/OwnJSONPatternFormatter.cpp | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/docs/en/operations/server-configuration-parameters/settings.md b/docs/en/operations/server-configuration-parameters/settings.md index 02fa5a8ca58..dd7f22f5c97 100644 --- a/docs/en/operations/server-configuration-parameters/settings.md +++ b/docs/en/operations/server-configuration-parameters/settings.md @@ -1629,6 +1629,7 @@ You can specify the log format that will be outputted in the console log. Curren ```json { + "date_time_utc": "2024-11-06T09:06:09Z", "date_time": "1650918987.180175", "thread_name": "#1", "thread_id": "254545", diff --git a/src/Loggers/OwnJSONPatternFormatter.cpp b/src/Loggers/OwnJSONPatternFormatter.cpp index 4263ad5925a..3eccb176c1f 100644 --- a/src/Loggers/OwnJSONPatternFormatter.cpp +++ b/src/Loggers/OwnJSONPatternFormatter.cpp @@ -7,12 +7,18 @@ #include #include #include +#include +#include + OwnJSONPatternFormatter::OwnJSONPatternFormatter(Poco::Util::AbstractConfiguration & config) { if (config.has("logger.formatting.names.date_time")) date_time = config.getString("logger.formatting.names.date_time", ""); + if (config.has("logger.formatting.names.date_time_utc")) + date_time_utc= config.getString("logger.formatting.names.date_time_utc", ""); + if (config.has("logger.formatting.names.thread_name")) thread_name = config.getString("logger.formatting.names.thread_name", ""); @@ -41,6 +47,7 @@ OwnJSONPatternFormatter::OwnJSONPatternFormatter(Poco::Util::AbstractConfigurati && logger_name.empty() && message.empty() && source_file.empty() && source_line.empty()) { date_time = "date_time"; + date_time_utc = "date_time_utc"; thread_name = "thread_name"; thread_id = "thread_id"; level = "level"; @@ -62,8 +69,22 @@ void OwnJSONPatternFormatter::formatExtended(const DB::ExtendedLogMessage & msg_ const Poco::Message & msg = msg_ext.base; DB::writeChar('{', wb); + if (!date_time_utc.empty()) + { + writeJSONString(date_time_utc, wb, settings); + DB::writeChar(':', wb); + + DB::writeChar('\"', wb); + static const DateLUTImpl & utc_time_zone = DateLUT::instance("UTC"); + writeDateTimeTextISO(msg_ext.time_seconds, 0, wb, utc_time_zone); + + DB::writeChar('\"', wb); + print_comma = true; + } + if (!date_time.empty()) { + if (print_comma) DB::writeChar(',', wb); writeJSONString(date_time, wb, settings); DB::writeChar(':', wb); @@ -81,6 +102,7 @@ void OwnJSONPatternFormatter::formatExtended(const DB::ExtendedLogMessage & msg_ print_comma = true; } + if (!thread_name.empty()) { if (print_comma) From 25f73dfb555423ec88e60b5a25f76be927099022 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 7 Nov 2024 13:37:40 +0330 Subject: [PATCH 02/21] Added "date_time_utc" parameter to config file Signed-off-by: xogoodnow --- programs/server/config.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/programs/server/config.xml b/programs/server/config.xml index 9807f8c0d5a..98b4f47df74 100644 --- a/programs/server/config.xml +++ b/programs/server/config.xml @@ -70,12 +70,15 @@ You can specify log format(for now, JSON only). In that case, the console log will be printed in specified format like JSON. For example, as below: + {"date_time":"1650918987.180175","thread_name":"#1","thread_id":"254545","level":"Trace","query_id":"","logger_name":"BaseDaemon","message":"Received signal 2","source_file":"../base/daemon/BaseDaemon.cpp; virtual void SignalListener::run()","source_line":"192"} + {"date_time_utc":"2024-11-06T09:06:09Z","thread_name":"#1","thread_id":"254545","level":"Trace","query_id":"","logger_name":"BaseDaemon","message":"Received signal 2","source_file":"../base/daemon/BaseDaemon.cpp; virtual void SignalListener::run()","source_line":"192"} To enable JSON logging support, please uncomment the entire tag below. a) You can modify key names by changing values under tag values inside tag. For example, to change DATE_TIME to MY_DATE_TIME, you can do like: MY_DATE_TIME + date_time_utc b) You can stop unwanted log properties to appear in logs. To do so, you can simply comment out (recommended) that property from this file. For example, if you do not want your log to print query_id, you can comment out only tag. @@ -86,6 +89,7 @@ json date_time + date_time_utc thread_name thread_id level From 9ac9dea447bccac062510f28c5d4d5b915075b58 Mon Sep 17 00:00:00 2001 From: Payam Qorbanpour Date: Thu, 7 Nov 2024 13:48:20 +0330 Subject: [PATCH 03/21] Add 'date_time_utc' format to tests --- .../test_structured_logging_json/test.py | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index a7d048cc4bb..544f81600f6 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -1,8 +1,10 @@ import json +from datetime import datetime from xml.etree import ElementTree as ET import pytest + from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) @@ -58,12 +60,21 @@ def validate_log_level(config, logs): return True +def is_valid_utc_datetime(datetime_str): + try: + datetime_obj = datetime.strptime(datetime_str, "%Y-%m-%dT%H:%M:%S.%fZ") + return datetime_obj.tzinfo is None + except ValueError: + return False + + def validate_log_config_relation(config, logs, config_type): root = ET.fromstring(config) keys_in_config = set() if config_type == "config_no_keys": keys_in_config.add("date_time") + keys_in_config.add("date_time_utc") keys_in_config.add("thread_name") keys_in_config.add("thread_id") keys_in_config.add("level") @@ -85,9 +96,12 @@ def validate_log_config_relation(config, logs, config_type): keys_in_log.add(log_key) if log_key not in keys_in_config: return False - for config_key in keys_in_config: - if config_key not in keys_in_log: - return False + + # Validate the UTC datetime format in "date_time_utc" if it exists + if "date_time_utc" in json_log and not is_valid_utc_datetime( + json_log["date_time_utc"] + ): + return False except ValueError as e: return False return True From 27fc62ae6ac6e67d02836d77d3c83bfa76bdc030 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 7 Nov 2024 14:00:43 +0330 Subject: [PATCH 04/21] Changed custom name for consistency with other example Signed-off-by: xogoodnow --- programs/server/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/server/config.xml b/programs/server/config.xml index 98b4f47df74..8ec49d804bd 100644 --- a/programs/server/config.xml +++ b/programs/server/config.xml @@ -78,7 +78,7 @@ a) You can modify key names by changing values under tag values inside tag. For example, to change DATE_TIME to MY_DATE_TIME, you can do like: MY_DATE_TIME - date_time_utc + MY_UTC_DATE_TIME b) You can stop unwanted log properties to appear in logs. To do so, you can simply comment out (recommended) that property from this file. For example, if you do not want your log to print query_id, you can comment out only tag. From a3bfb57da1d8c007c1aabd43f5145214cbc3bdbf Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 7 Nov 2024 15:27:41 +0330 Subject: [PATCH 05/21] Ran black Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index 544f81600f6..4b3f4eb6b96 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -1,12 +1,10 @@ import json from datetime import datetime from xml.etree import ElementTree as ET +from helpers.cluster import ClickHouseCluster import pytest - -from helpers.cluster import ClickHouseCluster - cluster = ClickHouseCluster(__file__) node_all_keys = cluster.add_instance( "node_all_keys", main_configs=["configs/config_all_keys_json.xml"] From b97d78e7f4f9301e3660d31d908b97bba88760e0 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 7 Nov 2024 15:35:17 +0330 Subject: [PATCH 06/21] Third party library must come before local imports (according to isort) Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index 4b3f4eb6b96..ae244dde71e 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -1,10 +1,10 @@ import json from datetime import datetime from xml.etree import ElementTree as ET -from helpers.cluster import ClickHouseCluster import pytest +from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) node_all_keys = cluster.add_instance( "node_all_keys", main_configs=["configs/config_all_keys_json.xml"] From acafa37e2d48eeee04931b029769cd1bbcac2069 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 7 Nov 2024 15:53:18 +0330 Subject: [PATCH 07/21] Ran black for style check Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index ae244dde71e..bc5f9753f4d 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -5,6 +5,7 @@ from xml.etree import ElementTree as ET import pytest from helpers.cluster import ClickHouseCluster + cluster = ClickHouseCluster(__file__) node_all_keys = cluster.add_instance( "node_all_keys", main_configs=["configs/config_all_keys_json.xml"] From aaa46a95c2160eb74d980bd268f38a664658bdb2 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 7 Nov 2024 18:44:01 +0330 Subject: [PATCH 08/21] Declared the new parameter Signed-off-by: xogoodnow --- src/Loggers/OwnJSONPatternFormatter.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Loggers/OwnJSONPatternFormatter.h b/src/Loggers/OwnJSONPatternFormatter.h index 51827f34b22..ab96c4e5bff 100644 --- a/src/Loggers/OwnJSONPatternFormatter.h +++ b/src/Loggers/OwnJSONPatternFormatter.h @@ -33,6 +33,7 @@ public: private: std::string date_time; + std::string date_time_utc; std::string thread_name; std::string thread_id; std::string level; From 19e6274a403801ebc37e42954dfa98c70d27eb34 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Sun, 10 Nov 2024 15:40:25 +0330 Subject: [PATCH 09/21] Fixed a typo Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index bc5f9753f4d..775d5be202c 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -114,7 +114,7 @@ def validate_logs(logs): return result -def valiade_everything(config, node, config_type): +def validate_everything(config, node, config_type): node.query("SELECT 1") logs = node.grep_in_log("").split("\n") return ( @@ -135,8 +135,8 @@ def test_structured_logging_json_format(start_cluster): ["cat", "/etc/clickhouse-server/config.d/config_no_keys_json.xml"] ) - assert valiade_everything(config_all_keys, node_all_keys, "config_all_keys") == True + assert validate_everything(config_all_keys, node_all_keys, "config_all_keys") == True assert ( - valiade_everything(config_some_keys, node_some_keys, "config_some_keys") == True + validate_everything(config_some_keys, node_some_keys, "config_some_keys") == True ) - assert valiade_everything(config_no_keys, node_no_keys, "config_no_keys") == True + assert validate_everything(config_no_keys, node_no_keys, "config_no_keys") == True From 5258bb6d01642306374e4317c40813a22e51b5b7 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Sun, 10 Nov 2024 16:21:01 +0330 Subject: [PATCH 10/21] Trigger pipeline From 01ca2b6947fcf0494d90b6f819a1f53c9e58aa03 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Sun, 10 Nov 2024 16:34:16 +0330 Subject: [PATCH 11/21] ran black Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index 775d5be202c..5fe49b784f2 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -135,8 +135,11 @@ def test_structured_logging_json_format(start_cluster): ["cat", "/etc/clickhouse-server/config.d/config_no_keys_json.xml"] ) - assert validate_everything(config_all_keys, node_all_keys, "config_all_keys") == True assert ( - validate_everything(config_some_keys, node_some_keys, "config_some_keys") == True + validate_everything(config_all_keys, node_all_keys, "config_all_keys") == True + ) + assert ( + validate_everything(config_some_keys, node_some_keys, "config_some_keys") + == True ) assert validate_everything(config_no_keys, node_no_keys, "config_no_keys") == True From 864a8a63dfbe649674366191d1b50586570fb12a Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Tue, 12 Nov 2024 23:38:22 +0330 Subject: [PATCH 12/21] Added a fix Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index 5fe49b784f2..5c2f1a1bef8 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -90,17 +90,17 @@ def validate_log_config_relation(config, logs, config_type): length = min(10, len(logs)) for i in range(0, length): json_log = json.loads(logs[i]) - keys_in_log = set() - for log_key in json_log.keys(): - keys_in_log.add(log_key) - if log_key not in keys_in_config: - return False + keys_in_log = set(json_log.keys()) + + if not keys_in_config.issubset(keys_in_log): + return False # Validate the UTC datetime format in "date_time_utc" if it exists if "date_time_utc" in json_log and not is_valid_utc_datetime( json_log["date_time_utc"] ): return False + except ValueError as e: return False return True From bf188495bd8cbf4962951ced5611246071c65b5e Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Wed, 13 Nov 2024 12:28:11 +0330 Subject: [PATCH 13/21] Included the new parameter within the config all keys file Signed-off-by: xogoodnow --- .../configs/config_all_keys_json.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/integration/test_structured_logging_json/configs/config_all_keys_json.xml b/tests/integration/test_structured_logging_json/configs/config_all_keys_json.xml index f20fda50319..4626a5bcffc 100644 --- a/tests/integration/test_structured_logging_json/configs/config_all_keys_json.xml +++ b/tests/integration/test_structured_logging_json/configs/config_all_keys_json.xml @@ -12,6 +12,7 @@ json DATE_TIME + DATE_TIME_UTC THREAD_NAME THREAD_ID LEVEL From 51b7916baa7b3e89b18134845e03404803a1ee3d Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Wed, 13 Nov 2024 12:31:56 +0330 Subject: [PATCH 14/21] Included the DATE_TIME_UTC parameter within the config files Signed-off-by: xogoodnow --- .../test_structured_logging_json/configs/config_json.xml | 1 + .../test_structured_logging_json/configs/config_no_keys_json.xml | 1 + .../configs/config_some_keys_json.xml | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/integration/test_structured_logging_json/configs/config_json.xml b/tests/integration/test_structured_logging_json/configs/config_json.xml index d2e9e284f4e..36f9363b015 100644 --- a/tests/integration/test_structured_logging_json/configs/config_json.xml +++ b/tests/integration/test_structured_logging_json/configs/config_json.xml @@ -11,6 +11,7 @@ json DATE_TIME + DATE_TIME_UTC THREAD_NAME THREAD_ID LEVEL diff --git a/tests/integration/test_structured_logging_json/configs/config_no_keys_json.xml b/tests/integration/test_structured_logging_json/configs/config_no_keys_json.xml index 21d1e9b34ec..b81c5ab3972 100644 --- a/tests/integration/test_structured_logging_json/configs/config_no_keys_json.xml +++ b/tests/integration/test_structured_logging_json/configs/config_no_keys_json.xml @@ -12,6 +12,7 @@ json From 32311c1db9759961af8c5fc9c3e4e1c4fa9848be Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Wed, 13 Nov 2024 12:39:02 +0330 Subject: [PATCH 16/21] Added comment for example log output Signed-off-by: xogoodnow --- .../configs/config_all_keys_json.xml | 1 + .../test_structured_logging_json/configs/config_no_keys_json.xml | 1 + .../configs/config_some_keys_json.xml | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/integration/test_structured_logging_json/configs/config_all_keys_json.xml b/tests/integration/test_structured_logging_json/configs/config_all_keys_json.xml index 4626a5bcffc..9336695f098 100644 --- a/tests/integration/test_structured_logging_json/configs/config_all_keys_json.xml +++ b/tests/integration/test_structured_logging_json/configs/config_all_keys_json.xml @@ -6,6 +6,7 @@ in specified format like JSON. For example, as below: {"date_time":"1650918987.180175","thread_name":"#1","thread_id":"254545","level":"Trace","query_id":"","logger_name":"BaseDaemon","message":"Received signal 2","source_file":"../base/daemon/BaseDaemon.cpp; virtual void SignalListener::run()","source_line":"192"} + {"date_time_utc":"2024-11-06T09:06:09Z","thread_name":"#1","thread_id":"254545","level":"Trace","query_id":"","logger_name":"BaseDaemon","message":"Received signal 2","source_file":"../base/daemon/BaseDaemon.cpp; virtual void SignalListener::run()","source_line":"192"} To enable JSON logging support, just uncomment tag below. --> diff --git a/tests/integration/test_structured_logging_json/configs/config_no_keys_json.xml b/tests/integration/test_structured_logging_json/configs/config_no_keys_json.xml index b81c5ab3972..e27ef328894 100644 --- a/tests/integration/test_structured_logging_json/configs/config_no_keys_json.xml +++ b/tests/integration/test_structured_logging_json/configs/config_no_keys_json.xml @@ -6,6 +6,7 @@ in specified format like JSON. For example, as below: {"date_time":"1650918987.180175","thread_name":"#1","thread_id":"254545","level":"Trace","query_id":"","logger_name":"BaseDaemon","message":"Received signal 2","source_file":"../base/daemon/BaseDaemon.cpp; virtual void SignalListener::run()","source_line":"192"} + {"date_time_utc":"2024-11-06T09:06:09Z","thread_name":"#1","thread_id":"254545","level":"Trace","query_id":"","logger_name":"BaseDaemon","message":"Received signal 2","source_file":"../base/daemon/BaseDaemon.cpp; virtual void SignalListener::run()","source_line":"192"} To enable JSON logging support, just uncomment tag below. --> diff --git a/tests/integration/test_structured_logging_json/configs/config_some_keys_json.xml b/tests/integration/test_structured_logging_json/configs/config_some_keys_json.xml index 7281bfb233d..3a0c1feb55b 100644 --- a/tests/integration/test_structured_logging_json/configs/config_some_keys_json.xml +++ b/tests/integration/test_structured_logging_json/configs/config_some_keys_json.xml @@ -6,6 +6,7 @@ in specified format like JSON. For example, as below: {"date_time":"1650918987.180175","thread_name":"#1","thread_id":"254545","level":"Trace","query_id":"","logger_name":"BaseDaemon","message":"Received signal 2","source_file":"../base/daemon/BaseDaemon.cpp; virtual void SignalListener::run()","source_line":"192"} + {"date_time_utc":"2024-11-06T09:06:09Z","thread_name":"#1","thread_id":"254545","level":"Trace","query_id":"","logger_name":"BaseDaemon","message":"Received signal 2","source_file":"../base/daemon/BaseDaemon.cpp; virtual void SignalListener::run()","source_line":"192"} To enable JSON logging support, just uncomment tag below. --> From 1ccd88e6df2c247aed19404fff0e5272729e99d6 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 14 Nov 2024 13:12:55 +0330 Subject: [PATCH 17/21] By default the "date_time_utc" is not included in the log Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index 5c2f1a1bef8..fa2dd806f2c 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -73,7 +73,6 @@ def validate_log_config_relation(config, logs, config_type): if config_type == "config_no_keys": keys_in_config.add("date_time") - keys_in_config.add("date_time_utc") keys_in_config.add("thread_name") keys_in_config.add("thread_id") keys_in_config.add("level") From 140bd01427b24f86de413f58b99f66601db6f3bc Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 14 Nov 2024 19:20:30 +0330 Subject: [PATCH 18/21] Corrected the check for time format Signed-off-by: xogoodnow --- .../integration/test_structured_logging_json/test.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index fa2dd806f2c..fe511aa3eaf 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -61,10 +61,14 @@ def validate_log_level(config, logs): def is_valid_utc_datetime(datetime_str): try: - datetime_obj = datetime.strptime(datetime_str, "%Y-%m-%dT%H:%M:%S.%fZ") - return datetime_obj.tzinfo is None + datetime.strptime(datetime_str, "%Y-%m-%dT%H:%M:%S.%fZ") + return True except ValueError: - return False + try: + datetime.strptime(datetime_str, "%Y-%m-%dT%H:%M:%SZ") # Without milliseconds + return True + except ValueError: + return False def validate_log_config_relation(config, logs, config_type): @@ -73,6 +77,7 @@ def validate_log_config_relation(config, logs, config_type): if config_type == "config_no_keys": keys_in_config.add("date_time") + keys_in_config.add("date_time_utc") keys_in_config.add("thread_name") keys_in_config.add("thread_id") keys_in_config.add("level") From 5ae6572cd66486129edc9b23b4949a6695e551fc Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 14 Nov 2024 19:33:32 +0330 Subject: [PATCH 19/21] ran black Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index fe511aa3eaf..fea573910ec 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -65,7 +65,9 @@ def is_valid_utc_datetime(datetime_str): return True except ValueError: try: - datetime.strptime(datetime_str, "%Y-%m-%dT%H:%M:%SZ") # Without milliseconds + datetime.strptime( + datetime_str, "%Y-%m-%dT%H:%M:%SZ" + ) return True except ValueError: return False From 99e5e550da68868f92c267c95fdab07c220b0776 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Thu, 14 Nov 2024 19:47:30 +0330 Subject: [PATCH 20/21] Omitted comment and reformatted Signed-off-by: xogoodnow --- tests/integration/test_structured_logging_json/test.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/integration/test_structured_logging_json/test.py b/tests/integration/test_structured_logging_json/test.py index fea573910ec..7ea3d26ba94 100644 --- a/tests/integration/test_structured_logging_json/test.py +++ b/tests/integration/test_structured_logging_json/test.py @@ -65,9 +65,7 @@ def is_valid_utc_datetime(datetime_str): return True except ValueError: try: - datetime.strptime( - datetime_str, "%Y-%m-%dT%H:%M:%SZ" - ) + datetime.strptime(datetime_str, "%Y-%m-%dT%H:%M:%SZ") return True except ValueError: return False From d55ebb19e0106367387efc6ddb2fc0f903e61107 Mon Sep 17 00:00:00 2001 From: xogoodnow Date: Fri, 15 Nov 2024 11:10:31 +0330 Subject: [PATCH 21/21] Re run pipeline