EL 6: Asynchronous Custom trace listener or MSMQ Distributor

Topics: Logging Application Block
Jun 3, 2013 at 10:02 PM
I got EL 6 recently and see an option of asynchronous for trace listeners. Is it available for custom trace listeners too?

If it is, then how does it compare with MSMQ Distributor? How do I chose which one to use?

Jun 4, 2013 at 3:01 AM
Yes, any trace listener (including custom) can be wrapped in an AsynchronousTraceListenerWrapper.

MSMQ Distributor Service is different than an asynchronous trace listener. Some of the differences:
  • Distributor Service is out of process while async listeners are in process
  • Distributor Service supports transactions so messages should be guaranteed to be delivered whereas async listeners may lose messages (buffer overflow or shutdown)
  • Distributor Service provides a centralized logging service that can aggregate log entries from different servers or applications
Asynchronous logging may be useful if there are high volumes of trace messages or where application performance is important (since the Write method will return without waiting for the write to complete). As mentioned, the downside risk for asynchronous logging is that if the internal buffer overflows or the application shuts down before all the entries are flushed, you will lose some log messages.

Randy Levy
Enterprise Library support engineer
Support How-to