Custom Event Listener

Topics: Semantic Logging Application Block
Jun 5, 2013 at 9:56 AM
Edited Jun 5, 2013 at 10:34 AM

I have created a custom event listener, but am getting the following error when running SemanticLogging-svc.exe -c
"The event listener defintion with the name 'custom'was not found."
The SemanticLoggign-sv.xml has this in it
    <eventSource name="MySource">
        <eventListener name="custom" level="LogAlways"/>
    <myEventListener xmlns=""
The MyEventListererElement is
[XmlRoot("myEventListener", Namespace = "")]
  public class MyEventListenerElement : EventListenerElement 
    public string Host { get; set; }

    public int Port { get; set; }

    public override IEventListener CreateEventListener(Func<string, IEventTextFormatter> formatterFactory)
      return new MyEventListener( this.Host, this.Port );
Then a MyEventListener with arb code in it
public class MyEventListener : IEventListener ...
I am sure it must be something simple I am missing ?

Jun 5, 2013 at 10:53 AM
Hi Steve,

Notice that the code you are using was from the CTP and not the final release. For details about writing custom listener (sinks) for out-of-process scenario you can find some good pointers in page 160 of Developer's Guide to Enterprise Library and in the Samples under the folder "SLABExtensibility".

Jun 5, 2013 at 10:58 AM
Thanks, I will check that out.