Custom InstrumentationConsumer for FailureLoggingError

Topics: Logging Application Block
Sep 9, 2010 at 6:13 AM

I need to be notified if the Logging application block fails to write an entry. I see that LoggingInstrumentationListener listens for the FailureLoggingError, how do I get a custom implementation to be called?

Sep 10, 2010 at 3:34 AM

AFAIK, there's no extension point in entlib for that.

Sep 10, 2010 at 4:55 AM

So at present you have no way of knowing if the LoggingApplicationBlock failed to write something? (Other than checking the event log?)

Robert Rolls | Principal Solutions Developer

Application and Integration
Avanade Australia Pty Ltd | Brisbane

Level 4, 139 Coronation Drive, Milton QLD 4064

Email: robert.rolls@avanade.com
Direct: +61 7 3119 9801

Mobile: +61 (0437) 044652

www.avanade.com/au

Eneterprise_Win_Gold

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.

Avanade collects personal information to provide and market services. We may be contacted at 02 9005 5900. We may share personal information with our related companies and with other organisations that assist us with administrative services and marketing. You may request access to the personal information we hold on you by contacting our HR Department. We use this information to manage our relationship with you, or provide you with the service requested, and if not provided our ability to do so will be diminished. For more information see our privacy policy at www.avanade.com or contact us on 02 9005 5900.

Sep 10, 2010 at 5:22 AM

You could new up your own DI container, load the entlib registrations into it, and then replace the registration for the instrumentation provider with your own implementation before accessing the logging block.

 

Sep 10, 2010 at 8:10 AM
Chris,
That sounds wonderful do you have any pointers on how to do this :o) Looking at the code the LoggingApplicationBlock calls new to get hold of the Instrumentation provider - doesn't it need to builtup via unity for the replacement implementation to be injected?
R.

From: ctavares [notifications@codeplex.com]
Sent: Friday, September 10, 2010 3:22 PM
To: Robert Rolls
Subject: Re: Custom InstrumentationConsumer for FailureLoggingError [entlib:226563]

From: ctavares

You could new up your own DI container, load the entlib registrations into it, and then replace the registration for the instrumentation provider with your own implementation before accessing the logging block.

Sep 10, 2010 at 5:04 PM

Well, the first question is: which version of Entlib are you talking about? My suggestion will only work on Entlib 5.

 

Sep 10, 2010 at 10:20 PM
lol I'm 4.1 :o) If you could suggest how to 'update' the code within 4.1 that would be handy too :o)

From: ctavares [notifications@codeplex.com]
Sent: Saturday, September 11, 2010 3:04 AM
To: Robert Rolls
Subject: Re: Custom InstrumentationConsumer for FailureLoggingError [entlib:226563]

From: ctavares

Well, the first question is: which version of Entlib are you talking about? My suggestion will only work on Entlib 5.