<p>When logging with Log4Net it's very easy to put class that called the log into the log file.  I've found in the past that this makes it very easy to trace through the code and see the flow through the classes.  In Log4Net I use the %logger property in the conversion pattern like so: </p>

<pre><code>&lt;conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" /&gt;
</code></pre>

<p>And this gives me the output I want: </p>

<p><code>2008-09-19 15:40:26,906 [3132] ERROR &lt;b&gt;Log4NetTechDemo.Tester&lt;/b&gt; [(null)] - Failed method</code></p>

<p>You can see from the output that the class that has called the log is Log4NetTechDemo.Tester, so I can trace the error back to that class quite easily.</p>

<p>In the Logging Applicaton Block I cannot figure out how to do this with a simple log call.  Does anyone know how it can be done?  If so, an example or steps to do so would be very helpful.</p>

We havn't found an easy way without hitting the StackTrace.  If it's an exception, we just grab from that:
```
```
StackTrace trace = new StackTrace(ex, true);
 StackFrame frame = trace.GetFrame(0);
```
```
For chatty items, we just write the string.  We have a snippet that's able to grab the class name on insertion.  We also declare the const string with the class name.
Not pretty, but it's the best we've found.  I hope someone else has a bettwe answer in this thread  :)