title: How to create a file in the AppData folder using log4net
body: <p>How to create the log file in appData folder. The path is C:\Users\MYNAME\AppData\Roaming\Project\My Project\Application. As soon as my project starts, the project folder is created on this path where this path is hard coded. How can I add my log file in this folder using log4net? 
  I have made changes in the config file </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
  &lt;configSections&gt;
      &lt;section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/&gt;
  &lt;/configSections&gt;
  &lt;log4net&gt;
      &lt;appender name="Console" type="log4net.Appender.ConsoleAppender"&gt;
          &lt;layout type="log4net.Layout.PatternLayout"&gt;
              &lt;!-- Pattern to output the caller's file name and line    number --&gt;
              &lt;conversionPattern value="%5level [%thread] (%file:%line) - %message%newline" /&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
      &lt;appender name="RollingFile" type="log4net.Appender.RollingFileAppender"&gt;
  
          &lt;file value="${APPDATA}\\Roaming\\Project\\My Project\\Application\\Log.txt"/&gt;
          &lt;appendToFile value="true" /&gt;
          &lt;maximumFileSize value="100KB" /&gt;
          &lt;maxSizeRollBackups value="10" /&gt;
          &lt;layout type="log4net.Layout.PatternLayout"&gt;            
              &lt;conversionPattern value="%level %thread %logger - %message%newline" /&gt;
          &lt;/layout&gt;
      &lt;/appender&gt;
      &lt;root&gt;
          &lt;level value="ALL" /&gt;
          &lt;appender-ref ref="Console" /&gt;
          &lt;appender-ref ref="RollingFile" /&gt;
      &lt;/root&gt;
  &lt;/log4net&gt;
  &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/&gt;
  &lt;/startup&gt;
  &lt;system.serviceModel&gt;
      &lt;bindings /&gt;
      &lt;client /&gt;
  &lt;/system.serviceModel&gt;
   &lt;/configuration&gt;
  </code></pre>
  
  <p>This doesn't create any files in this folder. And all the permissions are granted being Administrator. </p>