From e01bc29b24da3cb945203cb33668e2dde6c4eeb3 Mon Sep 17 00:00:00 2001 From: Andrey Kislyuk Date: Mon, 20 Feb 2023 17:21:14 -0800 Subject: [PATCH] Use getMessage with add_log_record_attrs --- watchtower/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watchtower/__init__.py b/watchtower/__init__.py index 4deee19..ae448d6 100644 --- a/watchtower/__init__.py +++ b/watchtower/__init__.py @@ -126,7 +126,7 @@ def __init__( def format(self, message): if self.add_log_record_attrs: - msg = message.msg if isinstance(message.msg, Mapping) else {"msg": message.msg} + msg = message.msg if isinstance(message.msg, Mapping) else {"msg": message.getMessage()} for field in self.add_log_record_attrs: if field != "msg": msg[field] = getattr(message, field) # type: ignore