logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sclo...@consultant.com
Subject Writing to the event
Date Tue, 17 Aug 2010 09:08:22 GMT


Hi,

 I'm wondering can you help me please? I want to use log4net to write error logs to the application
event viewer. Specifically what I want to do is to send down an error mesage and event number
inside the body of the log method. The event number should appear under the "event" column
in the event viewer and the error in the "Description" field of the Event Properties.

something like:

log.Error(1234, someErrorInfo)
or 
log.Info(1234, someErrorInfo)

where the 1234 will appear in the "Event" column etc...

 Problem is though I'm not sure how to do it. I know that I need something beginning 
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">

inside the .config but that's a far as I get. I would appreciate some help guidance code-samples
perhaps in this regard.

Cheers,
S.





Mime
View raw message