title: Proper way to shutdown a logger instance in log4Net
body: <p>I have a class to whose every instance i create a new logger and attache a buffer appender and a flie appender to it. <strong><em>Everything is being done runtime and no information is picked from the config file.</em></strong> </p>
  
  <p>Now to release resources at the class's custom dispose method i need to shutdown that specific logger and release all of its attached resources so as to avoid any memory leak.</p>
  
  <p>At the moment what i have been doing is atleast flush the file appender and write all logging information but that neither releases the lock on that specific logging file nor does it release any of its resources.</p>
  
  <p>What is the proper way of shutting down the logger while not shutting down other active loggers that are in process</p>
  
  <pre><code>log4net.ILog log = log4net.LogManager.GetLogger(loggerName);
  
  foreach (IAppender iapp in log.Logger.Repository.GetAppenders())
  {
      BufferingAppenderSkeleton buffered = iapp as BufferingAppenderSkeleton;
      if (buffered is BufferingForwardingAppender)
      {
          ((BufferingForwardingAppender)buffered).Flush();
      }
  }
  
  log.Logger.Repository.Shutdown();
  </code></pre>
  
  <p>I hope i have made my question clear enough :)</p>