You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by aa...@apache.org on 2022/10/13 15:41:58 UTC
[superset] 01/01: additional logging
This is an automated email from the ASF dual-hosted git repository.
aafghahi pushed a commit to branch arash/logAlertReports
in repository https://gitbox.apache.org/repos/asf/superset.git
commit aa1741a23d7cc5e6858e5cc7ee60868e74a1ca01
Author: AAfghahi <ar...@gmail.com>
AuthorDate: Thu Oct 13 11:41:21 2022 -0400
additional logging
---
superset/reports/notifications/email.py | 4 +++-
superset/utils/core.py | 6 ++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/superset/reports/notifications/email.py b/superset/reports/notifications/email.py
index 358294f1e1..1f042ded83 100644
--- a/superset/reports/notifications/email.py
+++ b/superset/reports/notifications/email.py
@@ -207,6 +207,8 @@ class EmailNotification(BaseNotification): # pylint: disable=too-few-public-met
dryrun=False,
header_data=content.header_data,
)
- logger.info("Report sent to email")
+ logger.info(
+ "Report sent to email, notification content is %s", content.header_data
+ )
except Exception as ex:
raise NotificationError(ex) from ex
diff --git a/superset/utils/core.py b/superset/utils/core.py
index 2786cfa27f..7fba35f09a 100644
--- a/superset/utils/core.py
+++ b/superset/utils/core.py
@@ -1003,8 +1003,9 @@ def send_mime_email(
smpt_ssl_server_auth = config["SMTP_SSL_SERVER_AUTH"]
if dryrun:
- logger.info("Dryrun enabled, email notification content is below:")
- logger.info(mime_msg.as_string())
+ logger.info(
+ "Dryrun enabled, email notification content is %s", mime_msg.as_string()
+ )
return
# Default ssl context is SERVER_AUTH using the default system
@@ -1020,6 +1021,7 @@ def send_mime_email(
if smtp_user and smtp_password:
smtp.login(smtp_user, smtp_password)
logger.debug("Sent an email to %s", str(e_to))
+ logger.info("Sent email notification content is %s", mime_msg.as_string())
smtp.sendmail(e_from, e_to, mime_msg.as_string())
smtp.quit()