title: log4net issue in web service
body: <p>We are successfully using log4net in our UI Layer but when we are testing in Webservice layer it does not work.</p>
  
  <p>Here is the code in UI Layer:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public partial class _Default : System.Web.UI.Page 
  {
  
    ILog logger = log4net.LogManager.GetLogger(typeof(_Default));
  
  
    protected void Page_Load(object sender, EventArgs e)
    {
        ServiceReference1.IService1 is1 = new ServiceReference1.Service1Client();
        is1.GetData(1);
  
        logger.Info("Hello Nine Thanks for use Log4Net,This is info message");
        logger.Debug("Hello Nine Thanks for use Log4Net,This is Debug message");
        logger.Error("Hello Nine Thanks for use Log4Net,This is Error message");
        logger.Warn("Hello Nine Thanks for use Log4Net,This is Warn message");
        logger.Fatal("Hello Nine Thanks for use Log4Net,This is Fatal message");
  
    }
  }
  </code></pre>
  
  <hr>
  
  <p>Here is the web.config settings for the UI Layer:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;log4net&gt;
      &lt;appender name="FileAppender" type="log4net.Appender.FileAppender"&gt;
    &lt;param name="File" value="MyloggerSite2.log"/&gt; &lt;!-- This is logging in app root folder --&gt;
  
          &lt;param name="AppendToFile" value="true"/&gt;
          &lt;layout type="log4net.Layout.PatternLayout"&gt;
              &lt;param name="ConversionPattern" value="%d [%t] %-2p %c [%x] - %m%n"/&gt;
  
          &lt;/layout&gt;
      &lt;/appender&gt;
      &lt;root&gt;
    &lt;level value="All"/&gt;
          &lt;appender-ref ref="FileAppender"/&gt;
      &lt;/root&gt;
  &lt;/log4net&gt;
  </code></pre>
  
  <hr>
  
  <p>Here is the code in ServiceLayer which does not work although it it is the same as above for the most:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class Service1 : IService1
  {
      public string GetData(int value)
      {
          ILog logger = log4net.LogManager.GetLogger(typeof(Service1));
  
          logger.Info("Hello Nine Thanks for use Log4Net,This is info message");
          logger.Debug("Hello Nine Thanks for use Log4Net,This is Debug message");
          logger.Error("Hello Nine Thanks for use Log4Net,This is Error message");
          logger.Warn("Hello Nine Thanks for use Log4Net,This is Warn message");
          logger.Fatal("Hello Nine Thanks for use Log4Net,This is Fatal message");
  
          return string.Format("You entered: {0}", value);
      }
   }
  </code></pre>
  
  <p>Please let me know if you have any suggestions.
  Thanks,
  N</p>