Error from listener

Topics: Logging Application Block
Jun 15, 2010 at 8:15 AM

Hi All

If the write of a listener failed for some reason or the validation method failed and way of getting the reason back to the application to know what happened ?

Many thanks

Paul

Jun 16, 2010 at 12:41 AM

The Logging Application Block is designed that way.  You won't get any exception.  You'll only be able to view logs indicating what exception(s) occured while logging if you configured trace listener(s) under the Logging Errors and Warnings section.

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com

Jun 18, 2010 at 2:45 PM

Hi Sarah

Thanks for your reply, maybe to solve this from a different angle. Is it possible to show an error in the configuration tool when editing the app.config when say a listener requires a application setting to be present ?

Many thx

Paul

 

Jun 21, 2010 at 1:17 AM

I assume you're referring to a custom trace listener you created?  If yes, then you can easily do that by creating a class which contains the validation logic.  You can use then the Validation attribute for validating a specific property of that trace listener or the ElementValidation attribute for validating at the trace listener element level.  You can refer to the entlib source code for the sample code; the EmailTraceListenerData contains an ElementValidation attribute and the other trace listener data class contains Validation attributes.

 

 

Sarah Urmeneta
Global Technology and Solutions
Avanade, Inc.
entlib.support@avanade.com