From c4599d93e4e62600f41400f8037807fda34ab3e7 Mon Sep 17 00:00:00 2001 From: zawan-ila <87228907+zawan-ila@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:01:28 +0500 Subject: [PATCH] chore: allow custom log formatter (#4513) --- course_discovery/settings/base.py | 1 + course_discovery/settings/kubernetes.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/course_discovery/settings/base.py b/course_discovery/settings/base.py index 76c79a6ac2..2d578ac255 100644 --- a/course_discovery/settings/base.py +++ b/course_discovery/settings/base.py @@ -328,6 +328,7 @@ # Set up logging for development use (logging to stdout) level = 'DEBUG' if DEBUG else 'INFO' hostname = platform.node().split(".")[0] +LOGGING_FORMAT_STRING = '' # Use a different address for Mac OS X syslog_address = '/var/run/syslog' if platform.system().lower() == 'darwin' else '/dev/log' diff --git a/course_discovery/settings/kubernetes.py b/course_discovery/settings/kubernetes.py index 5ba1c1256d..01386c6fc0 100644 --- a/course_discovery/settings/kubernetes.py +++ b/course_discovery/settings/kubernetes.py @@ -25,8 +25,8 @@ def get_docker_logger_config(): 'disable_existing_loggers': False, 'formatters': { 'standard': { - 'format': '%(asctime)s %(levelname)s %(process)d ' - '[%(name)s] %(filename)s:%(lineno)d - %(message)s', + 'format': LOGGING_FORMAT_STRING or '%(asctime)s %(levelname)s %(process)d ' + '[%(name)s] %(filename)s:%(lineno)d - %(message)s' }, 'syslog_format': {'format': syslog_format}, 'raw': {'format': '%(message)s'},