title: How can I get log4net to write to a filename based on the class that instantiated the logger?
body: <p>This is my dilemma. I have a <code>RollingFileAppender</code>. I have a <code>BufferingForwardingAppender</code>. The forwarding appender writes to the file appender. My file appender needs a file to write to. I want the file to be named as such <code>%Called Assembly Type%log.txt</code>, where %Called Assembly Type% is the called assembly type (gasp!)</p>
  
  <p>I'm intending to use this as follows:</p>
  
  <p>Calling from a service called "<code>OkilyDokily</code>":</p>
  
  <pre><code>var log4NetLogger = LogManager.GetLogger(GetMyAssemblyName());
  log4NetLogger.LogInfo("Toodleoo");
  </code></pre>
  
  <p>Calling from a service called "<code>Neighborinos</code>":</p>
  
  <pre><code>var log4NetLogger = LogManager.GetLogger(GetMyAssemblyName());
  log4NetLogger.LogInfo("Toodleoo");
  </code></pre>
  
  <p>I expect to have 2 log files, one named <code>OkilyDokilylog.txt</code> and one named <code>Neighborinoslog.txt</code></p>
  
  <p>Is there a way to do this in log4net? Is my <code>BufferingForwardingAppender</code> going to be an issue? I have tried this configuration but <code>%logger</code> is simply translating to the string <code>logger</code> :(</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"&gt;
      &lt;file type="log4net.Util.PatternString"&gt;
          &lt;conversionPattern value="C:\testlogs\%logger log.txt" /&gt;
      &lt;/file&gt;
      &lt;appendToFile value="true" /&gt;
      &lt;rollingStyle value="Size" /&gt;
      &lt;maxSizeRollBackups value="-1" /&gt;
      &lt;maximumFileSize value="5KB" /&gt;
      &lt;staticLogFileName value="true" /&gt;
      &lt;countDirection value="1"/&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
          &lt;conversionPattern value="%-8level %-21date{M/d/yyyy H:m:ss} %message%newline" /&gt;
      &lt;/layout&gt;
  &lt;/appender&gt;
  </code></pre>