System events > The events.xml file

The events.xml file

The events.xml file in <install directory>\conf manages publishing events to log files and JMS routers. You must understand this file if you want to customize event configurations.

Each event contains standard information, including:

An event also may have specific information in the form of metadata content or extended event content.

The events.xml file that manages logged events is located at <Interchange install directory>\conf. You can edit this file to control what events are generated and where they are published. By default, some (but not all) events are configured in events.xml to determine how they are published to system log files in the logs directory (see Log file tracking). Using event routers, you also can publish events to a JMS queue.

In addition to using event routers that write events to log files or pass events to some other process, event filters provide a way for determining what events are delivered to a router. Events can be filtered based on type or level. You can build complex filters from multiple simple filters.

Caution   Before editing the events.xml file, it is recommended that you make a copy of it in case you want to restore the default configuration for events.

The default configuration of events.xml is to write an events log file for each system node to the logs directory. This results in the generation one or more log files that, for Activator, are named in the following format: <hostname>_te_events.log.

One of these event logs is the system control node events log. By default the name of the control node is the host name of the computer. The name of the events log file for the control node looks like this: <hostname>_cn_events.log.

EventRouters section of events.xml

The top portion of the events.xml file is for event routers. The following is an example of the default EventRouters section of the file.

For details on how to configure routers, see Log file event router and JMS event router.

An example of EventRouters section of events.xml follows:

In the default configuration of events.xml, use MetadataProcessorListRef only when you want to publish events at the Messaging level. This element is not needed in other event router configurations.

MetadataProcessors section of events.xml

The MetadataProcesssors section follows the EventRouter section of the events.xml file. The following is an example of the default MetadataProcessors section.

Caution   Although the following paragraphs explain this section of the file, it is imperative that you do not change it.

The MetadataProcessors element can have any number of MetadataProcessorList elements, each defining a list of metadata processors. Each MetadataProcessorList element must have a unique id attribute and can contain multiple MetadataProcessor elements, but is not required to have any. Each MetadataProcessor element must have a type attribute specifying an event type and a class attribute specifying the name of a class that implements the com.cyclonecommerce.events2.metadata.MetadataProcessor interface.

When an event router needs a metadata event content processor, it searches the referenced MetadataProcessorList element for the first MetadataProcessor element with an event type that matches the type of the event being processed by the event router. The event type in the MetadataProcessor element can be the exact type or a super-type of the router's event type. The MetadataProcessor elements are searched in the order specified.

EventFilters section of events.xml

The EventFilters section follows the MetadataProcessors section of the events.xml file. The following code is a partial example of the default EventFilters section.

An example of the EventFilters section of events.xml follows:

<EventFilters>
 <!---->
 <EventFilter id="Integrator">
  <OrFilter>
   <EventTypeFilter type="Messaging.Transport.ReceiveFailure"/>
   <EventTypeFilter type="Messaging.Packaging.DecryptionFailure"/>
   <EventTypeFilter type="Messaging.Packaging.SignatureVerificationFailure"/>
   <EventTypeFilter type="Messaging.Packaging.CertificateValidationFailure"/>
   <EventTypeFilter type="Messaging.Packaging.DecompressionFailure"/>
   <EventTypeFilter type="Messaging.Message.Collaboration"/>
   <EventTypeFilter type="Messaging.Message.MessagePackaged"/>
   <EventTypeFilter type="Messaging.Transport.SendFailure"/>
   <EventTypeFilter type="Messaging.Transport.OutputTransferCompleted"/>
   <EventTypeFilter type="Messaging.Transport.RetryFailure"/>
  </OrFilter>
 </EventFilter>
 <EventFilter id="Messaging To Database">
  <AndFilter>
   <EventTypeFilter type="Messaging"/>
   <OrFilter>
    <EventLevelFilter level="High"/>
    <EventLevelFilter level="Warning"/>
    <EventLevelFilter level="Error"/>
   </OrFilter>
  </AndFilter>
 </EventFilter>

The EventFilters element can have any number of EventFilter elements, each defining an event filter. Each EventFilter element must have an id attribute that specifies a unique identifier for the filter. Although more than one EventFilter element can have an id attribute with the same value, we recommend that each EventFilter element have its own id.

A filter defined by an EventFilter element only starts upon server startup when an EventRouter element references it directly or indirectly.

Each EventFilter element defines a single event filter. A single event filter can be simple or complex.

Simple filters

The following are simple event filters:

A filter that passes all events.

A filter that passes no events.

A filter that passes all events of a specified type or any of its sub-types. The type attribute must be specified and its value must be the name of an event type defined in Event tables.

For example, if you specify a type of Messaging.Message, all events with that prefix pass through the filter.

A filter that passes all events at the specified level and above. The level attribute must be specified and its value must be, in order of least to most important, Low, High, Warning or Error.

For example, if you specify a level of Low, all Low level messages pass through the filter, as well as all High, Warning and Error events. Conversely, if you specify a level of Error, only Error level events pass.

A filter that refers to another event filter. Using this mechanism supports the re-use of event filters. The ref attribute must be specified and its value must equal that of an id attribute in an EventFilter element. Circular filter references are not allowed.

Complex filters

The following are complex event filters:

A filter that passes all events that do not pass the simple or complex event filter defined within.

A filter that passes all events that pass all the event filters defined within.

A filter that passes all events that pass any of the event filters defined within.

Log file event router

The event system comes with a standard event router in events.xml that sends events to log files in the logs directory (Log file tracking). This outbound event router is implemented by the following Java class:

com.cyclonecommerce.events2.router.LogFileRouter

The default log file event router is configured in a system file for managing events. The file is <install directory>\conf\events.xml. The following is an example of how the log file event router is set up in events.xml. For other details about this file, see The events.xml file.

The MetadataProcessorListRef element references an element in the MetadataProcessors section of events.xml. The EventFilterRef element references a filter in the EventFilters section of events.xml. The following explains the attributes of the EventRouter and Parameters elements in the router definition.

EventRouter attributes

The following explains the attributes of the EventRouter element in a log file configuration in events.xml.

Parameters attributes

The following explains the attributes of the Parameters element in a log file configuration in events.xml.

JMS event router

With the help of Axway technical consultants, you can configure a router in events.xml to publish events to a JMS queue. To do so, you must have Java Message Service experience and a working JMS system.

Instructions for configuring a JMS event router are in the events.xml file.

Oracle AQ event router

With the help of Axway technical consultants, you can configure a router in events.xml to publish events to an Oracle Advanced Queuing facility (Oracle AQ) queue. To do so, you must have Java Message Service experience and a working Oracle AQ system.

Instructions for configuring an Oracle AQ event router are in the events.xml file.

XML for JMS and AQ event routers

Each event is serialized in XML form before being written to the JMS or AQ queue. Each event type can contain different data that is specific to the event type. The following is an example of such XML content:

Data common to all events

The following data are common to all events written to the JMS or AQ queue.

Data specific to message-related events

The following data are specific to message-related events written to the JMS or AQ queue.

Persistence event router

Up until version 5.4.2, the router to persist events to the database was active in the events.xml file. Effective with version 5.4.2, the event persistence router is inactive by default. A change in the way the system reports events makes it possible to no longer have to store events in the database, freeing database space and reducing data traffic.

The persistence event router remains in events.xml, but is commented out and inactive. See the following code example.

The persistence event router example in events.xml follows.

Keeping the router inactive is recommended. The cases for activating the router are rare (for example, a third-party back-end system retrieves event data from the database). Before activating, consult technical support.

Related topics