mirror of
https://github.com/ansible/awx.git
synced 2026-04-06 18:49:21 -02:30
fix up a bug in rsyslogd error handling
see: https://github.com/ansible/tower/issues/4915
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
# Django
|
# Django
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@@ -34,7 +35,8 @@ class RSysLogHandler(logging.handlers.SysLogHandler):
|
|||||||
# because the alternative is blocking the
|
# because the alternative is blocking the
|
||||||
# socket.send() in the Python process, which we definitely don't
|
# socket.send() in the Python process, which we definitely don't
|
||||||
# want to do)
|
# want to do)
|
||||||
msg = f'{record.asctime} ERROR rsyslogd was unresponsive: '
|
dt = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
msg = f'{dt} ERROR rsyslogd was unresponsive: '
|
||||||
exc = traceback.format_exc()
|
exc = traceback.format_exc()
|
||||||
try:
|
try:
|
||||||
msg += exc.splitlines()[-1]
|
msg += exc.splitlines()[-1]
|
||||||
|
|||||||
Reference in New Issue
Block a user