title: log4net multiple appenders, writing to event viewer
body: <p>I am using log4net for logging, I have two appenders one file and other eventlog appender. I have register application in registry editor, problem is now both logger are writing in event viewer. I need <code>fileAppender</code> to write in file and <code>eventLogAppender</code> to be shown in event viewer.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;log4net&gt;
  &lt;appender name="LogFileAppender" type="log4net.Appender.FileAppender"&gt;
    &lt;file value="file.log"/&gt;
    &lt;appendToFile value="false"/&gt;
    &lt;layout type="log4net.Layout.PatternLayout"&gt;
      &lt;header value="Logging Start &amp;#xD;&amp;#xA;"/&gt;
      &lt;footer value="Logging End &amp;#xD;&amp;#xA;"/&gt;
      &lt;conversionPattern value="%date [%thread] %-5level %logger: %message%newline"/&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;
  
  &lt;appender name="EventLogAppender" type="log4net.Appender.EventLogAppender"&gt;
  
    &lt;param name="ApplicationName" value="eventlog" /&gt;
    &lt;layout type="log4net.Layout.PatternLayout"&gt;
      &lt;conversionPattern value="%date [%thread] %-5level %logger - %message%newline" /&gt;
    &lt;/layout&gt;
  &lt;/appender&gt;
  
  &lt;root&gt;
    &lt;level value="DEBUG"/&gt;
    &lt;appender-ref ref="LogFileAppender"/&gt;
    &lt;appender-ref ref="EventLogAppender" /&gt;
  &lt;/root&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <p>and then in code</p>
  
  <pre><code>private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
  // private static readonly ILog log = LogManager.GetLogger("LogFileAppender");
  private static readonly ILog logEvents = LogManager.GetLogger("EventLogAppender");
  </code></pre>
  
  <p>I have tried different things but no one is working, any solution?</p>
  
  <p>Thanks!</p>