Improve logging for EventIpcManagerDefaultImpl

Description

Sometimes, it is important to know which events are being received by certain OpenNMS daemons, and also which events are being sent by the OpenNMS daemons.

Having the log level at DEBUG for the EventIpcManagerDefaultImpl class can give you that information without the need of enabling DEBUG for several daemons.

Unfortunately, the current implementation doesn't show enough information when "sending" an event, and shows too much information (and hard to consume) when "receiving" an event.

It would be nice to homologate the logging messages by re-implementing the "toString" method for all the "Event" classes, in order to show all the fields, ignoring the null ones and the empty collections.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Alejandro Galue June 26, 2017 at 2:29 PM

Alejandro Galue June 21, 2017 at 2:09 PM

Here is how the log messages look like currently:

sending

2017-06-18 06:00:31,426 DEBUG [Vacuumd-Thread-1-of-2] o.o.n.e.EventIpcManagerDefaultImpl: sending: org.opennms.netmgt.xml.event.Log@1e104b72[header=<null>,events=org.opennms.netmgt.xml.event.Events@31ca49ad[event=[org.opennms.netmgt.xml.event.Event@4e665de0[uuid=<null>,dbid=<null>,dist-poller=<null>,creation-time=Sun Jun 18 06:00:31 GMT 2017,master-station=<null>,mask=<null>,uei=uei.opennms.org/alarms/alarmDeleted,source=Automation,nodeid=<null>,time=Sun Jun 18 06:00:31 GMT 2017,host=<null>,interface=<null>,snmphost=<null>,service=<null>,snmp=<null>,parms=[org.opennms.netmgt.xml.event.Parm@43ed98f[parmName=alarmId,value=org.opennms.netmgt.xml.event.Value@7f827ec[content=18009670,type=string,encoding=text]], org.opennms.netmgt.xml.event.Parm@18e959a1[parmName=alarmEventUei,value=org.opennms.netmgt.xml.event.Value@7578743d[content=uei.opennms.org/nodes/nodeUp,type=string,encoding=text]], org.opennms.netmgt.xml.event.Parm@7b0dfc30[parmName=alarmReductionKey,value=org.opennms.netmgt.xml.event.Value@270e0f62[content=uei.opennms.org/nodes/nodeUp::95096,type=string,encoding=text]]],descr=<null>,logmsg=<null>,severity=<null>,pathoutage=<null>,correlation=<null>,operinstruct=<null>,autoaction=[],operaction=[],autoacknowledge=<null>,loggroup=[],tticket=<null>,forward=[],script=[],ifIndex=<null>,ifAlias=<null>,mouseovertext=<null>,alarm-data=<null>]]]]

receiving

2017-06-16 15:11:29,509 DEBUG [OpenNMS.TroubleTicketer-Thread] o.o.n.e.EventIpcManagerDefaultImpl: run: calling onEvent on OpenNMS.TroubleTicketer for event uei.opennms.org/troubleTicket/create dbid 75758162 with time 2017-06-16T15:11:29.502+0000
Fixed

Details

Assignee

Reporter

Components

Affects versions

Priority

PagerDuty

Created June 21, 2017 at 2:03 PM
Updated June 29, 2017 at 1:36 PM
Resolved June 29, 2017 at 1:36 PM

Flag notifications