From 34d0e548584c583e8a35d5a4670ec46159e73249 Mon Sep 17 00:00:00 2001 From: Sundaresan Rajangam Date: Wed, 29 Mar 2017 15:13:40 -0700 Subject: [PATCH] Log UVE and alarm config in exception traceback Change-Id: I8b14aaeec19efc5a89b6796deef109261fce6448 Closes-Bug: #1677359 --- src/opserver/alarmgen.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/opserver/alarmgen.py b/src/opserver/alarmgen.py index 7a1106f7cce..021c2531816 100644 --- a/src/opserver/alarmgen.py +++ b/src/opserver/alarmgen.py @@ -237,8 +237,9 @@ def process_alarms(self, alarm_fqname, alarm, uv, local_uve): except Exception as ex: template = "Exception {0} in Alarm Processing. Arguments:\n{1!r}" messag = template.format(type(ex).__name__, ex.args) - self._logger.error("%s : traceback %s" % \ - (messag, traceback.format_exc())) + self._logger.error("%s\n UVE:[%s]:%s\n Alarm config: %s\n traceback %s" % \ + (messag, uv, str(local_uve), alarm.config().alarm_rules, + traceback.format_exc())) self.uve_alarms[alarm_fqname] = UVEAlarmInfo(type=alarm_fqname, severity=sev, timestamp=0, token="", alarm_rules=AlarmRules(None),