From 54ebf606c374a0a21aae44a623c2157552d715bb Mon Sep 17 00:00:00 2001 From: ilee2u Date: Thu, 19 Dec 2024 14:58:40 -0500 Subject: [PATCH 1/2] chore: Refactor logging format for Datadog pipeline integration --- designer/settings/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer/settings/utils.py b/designer/settings/utils.py index ed80435f..d00ba3fc 100644 --- a/designer/settings/utils.py +++ b/designer/settings/utils.py @@ -14,6 +14,7 @@ def get_env_setting(setting): error_msg = "Set the [%s] env variable!" % setting raise ImproperlyConfigured(error_msg) + def get_logger_config(log_dir='/var/tmp', logging_env="no_env", edx_filename="edx.log", @@ -51,8 +52,7 @@ def get_logger_config(log_dir='/var/tmp', 'disable_existing_loggers': False, 'formatters': { 'standard': { - 'format': '%(asctime)s %(levelname)s %(process)d ' - '[%(name)s] %(filename)s:%(lineno)d - %(message)s', + 'format': '[%(name)s] [user %(userid)s] [ip %(remoteip)s] %(filename)s:%(lineno)d - %(message)s', }, 'syslog_format': {'format': syslog_format}, 'raw': {'format': '%(message)s'}, From a0e7f78f08bcc47a949ee805787c81d5dffb7933 Mon Sep 17 00:00:00 2001 From: ilee2u Date: Thu, 19 Dec 2024 15:30:33 -0500 Subject: [PATCH 2/2] chore: fix format string --- designer/settings/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer/settings/utils.py b/designer/settings/utils.py index d00ba3fc..2e04e549 100644 --- a/designer/settings/utils.py +++ b/designer/settings/utils.py @@ -52,7 +52,8 @@ def get_logger_config(log_dir='/var/tmp', 'disable_existing_loggers': False, 'formatters': { 'standard': { - 'format': '[%(name)s] [user %(userid)s] [ip %(remoteip)s] %(filename)s:%(lineno)d - %(message)s', + 'format': '%(asctime)s %(levelname)s [%(name)s] [%(filename)s:%(lineno)d] ' + '[dd.trace_id=%(dd.trace_id)s dd.span_id=%(dd.span_id)s] - %(message)s', }, 'syslog_format': {'format': syslog_format}, 'raw': {'format': '%(message)s'},