Events in FlexRule Server

◷ Reading Time: 4 minutes

Using domain events is the best way to collect relevant information and build Dashboards, Audit trails, Log entries, etc. FlexRule Server is an extensible event-driven platform, which means that when anything happens in FlexRule Server, a set of events will be published.

Any actions on the FlexRule Server by users or applications will raise domain events (i.e., events). You can subscribe to these events by their type and then channelize them to any data store and/or dashboard of your choice. This design maintains your ability to use any other platform (i.e., Splunk, Prometheus, datadoghq, Google Analytics, etc.) as your time-series event store. Or you can simply write a custom channel that pushes the events to your own custom location (e.g., MSSQL Server, MongoDB, etc.).


FlexRule Server uses a publish-subscribe pattern. You can write a subscriber and listen to raising events. Events have two states, before and after which allows listeners to capture one or both states.

Events are in the form of Static Types or JSON objects and they have a timestampunique identifiercorrelation id, and duration.

There are different categories of events:


  • PackageOwnershipChangedEvent
  • PackageSettingsUpdatedEvent
  • PackageDeletedEvent
  • PackageSavedEvent
  • PackageStatusChangedEvent


  • ServiceExecutionRequestedEvent
  • ServiceExecutedEvent
  • ServiceDeletedEvent
  • ServiceUpdatedEvent
  • ServiceStatusChangedEvent


  • CredentialRoleUpdatedEvent
  • RoleDeletedEvent
  • RoleCreatedEvent
  • RoleUpdatedEvent


  • FileChangesCommittedEvent
  • FilePinStrategyCahangedEvent


  • AgentCacheRefereshReceivedEvent
  • AgentListUpdatedEvent


  • AuthorizationTraceEvent
  • ConfigReadTraceEvent
  • DbTraceEvent
  • DomainServiceTraceEvent
  • ExceptionTraceEvent
  • ExceptionTraceEvent
  • HttpMessageTraceEvent
  • ValidationTraceEvent
  • WebApiTraceEvent
  • UnsuccessfulHttpResponseTraceEvent


In FlexRule Server you can create your own event monitoring plugin and register it as an event listener in the configuration file on either the Master or Agents. Each of the listeners in the monitoring can subscribe to multiple events which then redirect that to specific channel.


In monitoring the events section, use add to register listeners. monitoring/add has the attributes below:

  • event: name of an event from the above list. You can add multiple event names to listen to by separating them with a comma.
  • channel: the name of a channel that is registered in the channel section
  • level: allows you to store an event as an Error, Information, Warning, etc.


Inside channel registers different channels to which to push the events. channels/add has the attributes shown below:

  • initialData: allows you to provide data to initialize a channel (e.g., folder name, database connection, log service end-point address, etc.).
  • type: address of to the channel. You can use any TraceListener here. By default FlexRule Server uses two TraceListener for channels:
    • TextWriterTraceListener
    • Windows Event Log channel: EventLogTraceListener
  • name: name of the channel to be referenced by listeners

Details of different types of channels are explained here.


Below is the structure of listener and channels that can be managed by both Master and Agents.

<monitoring enabled="true" includeDetails="true" prettifyDetails="true">
    <add event="..." channel="..." level="..." />
        <add initializeData="..." 
             name="..." />

For example below is a sample configuration that registers AuthorizationTraceEvent events to be stored in a file located at c:\securefolder\authorizationErrors.log

<monitoring enabled="true" includeDetails="true" prettifyDetails="true">
    <add event="AuthorizationTraceEvent" channel="authorizationErrors" level="Error" />
        <add initializeData="c:\securefolder\authorizationErrors.log" 
             name="authorizationErrors" />

You can also create custom channels to store the events in anywhere that you need. For instance in a database, Azure blob storage and etc.

Custom Channels

Read more about it at Delivery Custom Channel.

Updated on November 2, 2020

Was this article helpful?

Related Articles