mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 13:39:27 -02:30
Enabled syslog by default for all 500 errors.
This commit is contained in:
@@ -85,3 +85,21 @@ DEFAULT_FROM_EMAIL = 'webmaster@localhost'
|
|||||||
# Subject-line prefix for email messages send with django.core.mail.mail_admins
|
# Subject-line prefix for email messages send with django.core.mail.mail_admins
|
||||||
# or ...mail_managers. Make sure to include the trailing space.
|
# or ...mail_managers. Make sure to include the trailing space.
|
||||||
EMAIL_SUBJECT_PREFIX = '[AWX] '
|
EMAIL_SUBJECT_PREFIX = '[AWX] '
|
||||||
|
|
||||||
|
# Enable logging to syslog. Setting level to ERROR captures 500 errors,
|
||||||
|
# WARNING also logs 4xx responses.
|
||||||
|
LOGGING['handlers']['syslog'] = {
|
||||||
|
'level': 'WARNING',
|
||||||
|
'filters': [],
|
||||||
|
'class': 'logging.handlers.SysLogHandler',
|
||||||
|
'address': '/dev/log',
|
||||||
|
'facility': 'local0',
|
||||||
|
'formatter': 'simple',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable the following lines to also log to a file.
|
||||||
|
#LOGGING['handlers']['file'] = {
|
||||||
|
# 'class': 'logging.FileHandler',
|
||||||
|
# 'filename': os.path.join(BASE_DIR, 'awx.log'),
|
||||||
|
# 'formatter': 'simple',
|
||||||
|
#}
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ LOGGING = {
|
|||||||
'formatter': 'simple',
|
'formatter': 'simple',
|
||||||
},
|
},
|
||||||
'syslog': {
|
'syslog': {
|
||||||
'level': 'ERROR',
|
'level': 'WARNING',
|
||||||
'filters': ['require_debug_false'],
|
'filters': ['require_debug_false'],
|
||||||
'class': 'django.utils.log.NullHandler',
|
'class': 'django.utils.log.NullHandler',
|
||||||
'formatter': 'simple',
|
'formatter': 'simple',
|
||||||
|
|||||||
@@ -87,3 +87,21 @@ DEFAULT_FROM_EMAIL = 'webmaster@localhost'
|
|||||||
# Subject-line prefix for email messages send with django.core.mail.mail_admins
|
# Subject-line prefix for email messages send with django.core.mail.mail_admins
|
||||||
# or ...mail_managers. Make sure to include the trailing space.
|
# or ...mail_managers. Make sure to include the trailing space.
|
||||||
EMAIL_SUBJECT_PREFIX = '[AWX] '
|
EMAIL_SUBJECT_PREFIX = '[AWX] '
|
||||||
|
|
||||||
|
# Enable logging to syslog. Setting level to ERROR captures 500 errors,
|
||||||
|
# WARNING also logs 4xx responses.
|
||||||
|
LOGGING['handlers']['syslog'] = {
|
||||||
|
'level': 'WARNING',
|
||||||
|
'filters': [],
|
||||||
|
'class': 'logging.handlers.SysLogHandler',
|
||||||
|
'address': '/dev/log',
|
||||||
|
'facility': 'local0',
|
||||||
|
'formatter': 'simple',
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable the following lines to also log to a file.
|
||||||
|
#LOGGING['handlers']['file'] = {
|
||||||
|
# 'class': 'logging.FileHandler',
|
||||||
|
# 'filename': os.path.join(BASE_DIR, 'awx.log'),
|
||||||
|
# 'formatter': 'simple',
|
||||||
|
#}
|
||||||
|
|||||||
@@ -32,8 +32,14 @@ SECRET_KEY = file('/etc/awx/SECRET_KEY', 'rb').read().strip()
|
|||||||
|
|
||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
LOGGING = {
|
LOGGING['handlers']['syslog'] = {
|
||||||
'version': 1,
|
# ERROR captures 500 errors, WARNING also logs 4xx responses.
|
||||||
|
'level': 'ERROR',
|
||||||
|
'filters': ['require_debug_false'],
|
||||||
|
'class': 'logging.handlers.SysLogHandler',
|
||||||
|
'address': '/dev/log',
|
||||||
|
'facility': 'local0',
|
||||||
|
'formatter': 'simple',
|
||||||
}
|
}
|
||||||
|
|
||||||
SERVER_EMAIL = 'root@localhost'
|
SERVER_EMAIL = 'root@localhost'
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ SECRET_KEY = file('/etc/awx/SECRET_KEY', 'rb').read().strip()
|
|||||||
ALLOWED_HOSTS = ['*']
|
ALLOWED_HOSTS = ['*']
|
||||||
|
|
||||||
LOGGING['handlers']['syslog'] = {
|
LOGGING['handlers']['syslog'] = {
|
||||||
|
# ERROR captures 500 errors, WARNING also logs 4xx responses.
|
||||||
'level': 'ERROR',
|
'level': 'ERROR',
|
||||||
'filters': ['require_debug_false'],
|
'filters': ['require_debug_false'],
|
||||||
'class': 'logging.handlers.SysLogHandler',
|
'class': 'logging.handlers.SysLogHandler',
|
||||||
|
|||||||
Reference in New Issue
Block a user