title: logging in log4net to different appenders based on circumstances
body: <p>I am using log4net and in one class require logging to a RollingFile appender, but then in another class, I wish to log to the event log + rolling file + console appender.</p>
  
  <p>What is the best practice? and could I see some sample code?</p>
  
  <p>By the way to make things more difficult, I am using <em>Castle Windsor Logging Facility</em> with Log4net to resolve my Logger instance.</p>
  
  <p>If it helps, I was thinking this below, but have no idea if this is best practice, or how to activate a particular logger based on 'name' still utilising my current logger instance from windsor:</p>
  
  <p><strong>log4net.config:</strong></p>
  
  <pre><code>...
      &lt;logger name="EventLogOnly"&gt;
        &lt;level value="ALL" /&gt;
        &lt;appender-ref ref="EventLogAppender" /&gt;
      &lt;/logger&gt;
      &lt;logger name="ConsoleEventLog"&gt;
        &lt;level value="ALL" /&gt;
        &lt;appender-ref ref="ColoredConsoleAppender" /&gt;
        &lt;appender-ref ref="EventLogAppender" /&gt;
      &lt;/logger&gt;
  ...
  </code></pre>
  
  <p><strong>castle windsor container builder class:</strong></p>
  
  <pre><code>container.AddFacility("logging.facility", 
     new LoggingFacility(LoggerImplementation.Log4net, "log4net.config"));
  </code></pre>
  
  <p><strong>class in which to log:</strong></p>
  
  <pre><code>private ILogger Logger;
  public Test(ILogger logger) {
    Logger.Info("Can I log under event log only?");
    Logger.Info("Now can I log under both?");
  }
  </code></pre>
  
  <p>Thanks guys.</p>