I need to make my C# application to write log in Windows Event viewer.
I Used ,
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
<param name="ApplicationName" value="DataLoader" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value='{"Processed":"%d{yyyy-MM-dd HH:mm:ss}","Loglevel":"%p","Service":"DataLoader","Instance":"","AdditionalInfo":"%c{1}|%M","logtext":"%m%n"}'/>
</layout>
</appender>
No Errors in Console but it does not write logs in windows event viewer
public class MyEventSource:EventSource{ void Debug(string formatted, string message, string environment, string member, string path, int line) { WriteEvent(6, formatted, message, environment, member, path, line); } }
something like these – Iconoduly