Skip to content

Commit

Permalink
Add flag to enable and disable mail_admins logging handler
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankApiyo committed Jul 25, 2024
1 parent 6cfa401 commit 43caf82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
add_mail_admins_logging_handler: false
onadata_system_user: "onadata"
onadata_system_group: "{{ onadata_system_user }}"
onadata_system_user_home: "/home/{{ onadata_system_user }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,14 @@ LOGGING = {
},
},
'handlers': {
{% if add_mail_admins_logging_handler %}
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false', 'skip_suspicious_operations'],
'class': 'django.utils.log.AdminEmailHandler',
'email_backend': '{{ onadata_mail_admins_email_backend }}'
},
{% endif %}
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
Expand Down

0 comments on commit 43caf82

Please sign in to comment.