Senthil,
Thanks for the feedback.
> The Extension DLL is working fine. But when the logging
> actually happens through these extended methods, the log
> message is classified as INFO category irrespective of
> whether the original request comes as a WARNING or ERROR or
> FATAL. I rectified this shortcoming by changing the level
> (log4net.spi.level) parameter of the LoggingEvent constructor
> appropriately. In all, I changed a total of 3 lines, (@ line numbers:
> 52, 67, 82), in the "EventIDLogImpl.cs".
This is just a typo in the source for EventIDLogImpl as you correctly
point out it should be specifying the correct level to use.
> I notice one more issue: When I use the Info()/Warn()/...
> Methods overloaded by "log4net.Ext.EventID" everything is
> logged fine; BUT when I use the methods that do not take the
> EventID parameter, then I notice that the log4net system is
> printing only a "?" for the Location information (%l).
This is a more interesting issue. To work around this issue you will
need to override the base class logging methods and then delegate to
them. i.e.:
override public void Debug(object message)
{
base.Debug(message);
}
and so on for Info, Warn, Error and Fatal.
This issue is caused because log4net is looking for the wrong type in
the call stack when searching for the boundary between the calling
application and log4net, it is looking for the derived type rather than
the declaring type which is what is visible through the stack frame.
This is now fixed in the CVS version of log4net and the above overriding
will no longer be necessary.
Cheers,
Nicko
>
> Thanks and Regards
> Senthil SS.
>
>
> -----Original Message-----
> From: Nicko Cadell [mailto:[EMAIL PROTECTED]
> Sent: Monday, September 13, 2004 6:11 PM
> To: Log4NET Dev
> Subject: RE: Event ID in the EventLog
>
> In the beta 6 download there is an extension that supports
> passing the event ID to the logger. This is not built as part
> of the standard log4net binary.
>
> You need to build the extensions\log4net.Ext.EventID into
> your assembly or a separate assembly.
> Then get the logger using EventIDLogManager.GetLogger(...);
> You can then pass the event ID to each of the Debug(), Info() etc...
> methods.
>
> See the example in:
> examples\net\extensibility\EventIDLogApp\src
>
> Nicko
>
> > -----Original Message-----
> > From: Senthil Sivasubramanian S [mailto:[EMAIL PROTECTED]
> > Sent: 13 September 2004 13:14
> > To: [email protected]
> > Subject: Event ID in the EventLog
> >
> > Going by log4net 1.2.0 Beta 6 - Release notes, I have been
> trying to
> > get the Event ID information also logged in the Event
> Viewer. But I am
>
> > not able to figure out the correct way to do this.
> >
> > Would greatly appreciate if someone can shed more light on
> how to get
> > this working.
> >
> > Thanks
> > Senthil SS.
> >
> >
>