From 33a4e174be3cc356e94a616edf06caec9d4f164b Mon Sep 17 00:00:00 2001 From: kashyap-thacker <133846944+kashyap-thacker@users.noreply.github.com> Date: Wed, 19 Jul 2023 18:10:23 +0530 Subject: [PATCH] Update Source key and seperate log attribute (#4) --- python_common_logger/src/utils/logger.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python_common_logger/src/utils/logger.py b/python_common_logger/src/utils/logger.py index f3d83fb..295e8ef 100644 --- a/python_common_logger/src/utils/logger.py +++ b/python_common_logger/src/utils/logger.py @@ -41,10 +41,13 @@ def create_json_formatter(service_name: str, context_config:dict=None, date_form Formatter: Log formatter """ log_format = { - "source": f"{service_name}", + "src": f"{service_name}", "time": "%(asctime)s", "log": { - "message": "[%(filename)s:%(funcName)s:%(lineno)s] %(message)s" + "message": "%(message)s", + "filename": "%(filename)s", + "funcName": "%(funcName)s", + "lineno": "%(lineno)s" }, "logLevel": "%(levelname)s" }