title: Enterprise Library 5.0 Logging Block customization
body: <p>Using Enterprise Library 5.0 Logging Block in .NET 4.0 which is the only Block I am using I was trying to customize information being logged to include Call Stack, calling Assembly name and perhaps Line Numbers. So I went to text Formatter that I created and added a few entries:</p>
  
  <pre><code>Method: {property(MethodName)}{newline}
  Call Stack:{property(CallStack)}
  </code></pre>
  
  <p>so after that matching text formatter config file entry now looks like this:</p>
  
  <pre><code>    &lt;formatters&gt;
          &lt;add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              template="Timestamp: {timestamp} &amp;#xA;Message: {message}{newline}&amp;#xA;Category: {category}{newline}&amp;#xA;Priority: {priority}{newline}&amp;#xA;EventId: {eventid}{newline}&amp;#xA;Severity: {severity}{newline}&amp;#xA;Title:{title}{newline}&amp;#xA;Machine: {localMachine}{newline}&amp;#xA;App Domain: {localAppDomain}{newline}&amp;#xA;ProcessId: {localProcessId}{newline}&amp;#xA;Process Name: {localProcessName}{newline}&amp;#xA;Thread Name: {threadName}{newline}&amp;#xA;Win32 ThreadId:{win32ThreadId}{newline}&amp;#xA;Extended Properties: {dictionary({key} - {value}{newline})}{newline}&amp;#xA;Method: {property(MethodName)}{newline}&amp;#xA;Call Stack:{property(CallStack)}"
              name="Text Formatter" /&gt;
      &lt;/formatters&gt;
  </code></pre>
  
  <p>You can see new added entries in there. But when I run it my logging entries look like this:</p>
  
  <pre><code>----------------------------------------
  Timestamp: 12/15/2011 9:51:48 PM 
  Message: Starting up the application
  
  Category: General
  
  Priority: -1
  
  EventId: 0
  
  Severity: Information
  
  Title:
  
  Machine: HCCLI066
  
  App Domain: WindowsFormsApplicationTest1.vshost.exe
  
  ProcessId: 2488
  
  Process Name: C:\Projects\WindowsFormsApplicationTest1\bin\Debug\WindowsFormsApplicationTest1.vshost.exe
  
  Thread Name: 
  
  Win32 ThreadId:2636
  
  Extended Properties: 
  
  Method: &lt;Error: property MethodName not found&gt;
  
  Call Stack:&lt;Error: property CallStack not found&gt;
  </code></pre>
  
  <hr>
  
  <p>Is there anything else I need to do to see those properties logged? How do I add completely custom property, like "Line Numbers" for example? </p>