Title: RE: WMI Appender

I'd like to reestablish conversation about WMI appender.
MS claims WMI events as an important part of monitoring solution, for example, see Monitoring in .NET Distributed Application Design. So, the possibility to raise WMI events is one of the key monitoring features for enterprise applications. WMI events are natively built in LIAB from MS Enterprise Library.

WMI event trigger mechanism used in WMI appender must be compatible with mechanism used in System.Management.Instrumentation. Otherwise, it will be more difficult for developers to register and develop custom WMI events.

Have you thought about the following log4net WMI appender functionality:
Introduce a new interface, like:
IWmiLoader
{
        void Init(object LoggingEvent);
        void Fire();
}

If LoggingEvent.MessageObject is not derived from System.Management.Instrumentation.BaseEvent
then get an assembly and class type from WMI appender configuration setting. This class must implement IWmiLoader interface. The WMI Appender initiates the class using LoggingEvent and triggers Fire method.

If LoggingEvent.MessageObject is derived from System.Management.Instrumentation.BaseEvent
then just trigger the fire method. If you do not want to have dependency on System.Management.Instrumentation namespace, you can check for IWmiLoader interface instead of System.Management.Instrumentation.BaseEvent.

In such case, WMI appender has no WMI events inside and does not need to be registered using installutil. Log4net may provide an example WMI event to be used in appender. Developers will usually customize the example WMI event to set application specific WMI namespace.

Alternative option is to inherit LoggingEvent from System.Management.Instrumentation.BaseEvent, like it is implemented in LIAB. But I think it is not an issue in such multiplatform project as log4net.

Currently, we are about implementing WMI appender inside the company, but I want to check with you to avoid double work when/if WMI appender will be released in log4net. Is the log4net community interested in our contributing to WMI appender development?

Thanks, Andrej

Reply via email to