Logging Application Block and Exception Handling Block

Topics: Exception Handling Application Block, Logging Application Block
Dec 7, 2010 at 3:58 AM

Hi All,

I would like to know what are the key scenarios where the Logging Application Block and Exception Handling Block can be used together.. Any help in this regard would be highly appreciated..

 

Thanks and Regards,

Toptorps

Dec 7, 2010 at 4:17 AM

Since EHAB is for handling exceptions and LAB is for logging, the obvious scenario when you would use them together is when you need to log the exception which occurred in your application.   Are you really asking for the scenario or you need other information which I didn't get based on your question?

 

Sarah Urmeneta
Global Technologies & Solutions
Avanade, Inc.
entlib.support@Avanade.com

Dec 7, 2010 at 4:43 AM

Thanks. I'm not sure abt the answer I'm looking for.. The solution u suggested seems pretty straightforward. EHAB has the provision for logging, if I'm not wrong.. So by using LAB, we can do logging with higher flexibility, right?

Toptorps

Dec 7, 2010 at 4:58 AM

Yes, EHAB leverages LAB to do logging through the Logging Exception Handler.  So just by calling

ExceptionPolicy.HandleException(exceptionToHandle, exceptionPolicyName);

this single line of code can automatically log the exception if you got the configuration right.

"So by using LAB, we can do logging with higher flexibility, right?"

Flexible in terms of what?  Just want to make sure we have the same concept of flexibility here.  LAB is flexible enough to log to different destinations just by modifying your config and without you having to change your application code.

 

Sarah Urmeneta
Global Technologies & Solutions
Avanade, Inc.
entlib.support@Avanade.com

Dec 7, 2010 at 5:13 AM

Yup, thats wot I meant.. Thanks for the help Sarah. Greatly appreciated.

Regards,

Toptorps