title: Formatter not set in custom trace listener for EnterpriseLibrary logging
body: <p>I have created a custom trace listener for the EnterpriseLibrary logging block, but the <code>Formatter</code> property is always null.</p>
  
  <p>This is the code:</p>
  
  <pre><code>using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
  using Microsoft.Practices.EnterpriseLibrary.Logging;
  using Microsoft.Practices.EnterpriseLibrary.Logging.Configuration;
  using Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners;
  using System;
  using System.Diagnostics;
  
  namespace test {
  
      [ConfigurationElementType(typeof(CustomTraceListenerData))]
      public class TestTraceListener : CustomTraceListener {
  
          public override void Write(string message) {
              Console.Write(message);
          }
  
          public override void WriteLine(string message) {
              Console.WriteLine(message);
          }
  
          public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data) {
              LogEntry entry = data as LogEntry;
              if (entry != null) {
                  if (Formatter != null) {
                      string formatted = Formatter.Format(entry);
                      WriteLine(formatted);
                  } else {
                      WriteLine(entry.Message);
                  }
              } else {
                  base.TraceData(eventCache, source, eventType, id, data);
              }
          }
  
      }
  
      class Program {
          static void Main(string[] args) {
              Logger.SetLogWriter(new LogWriterFactory().Create());
              LogEntry entry = new LogEntry("This is a test", "General", 0, 0, TraceEventType.Information, null, null);
              Logger.Write(entry);
          }
      }
  }
  </code></pre>
  
  <p>And this is the configuration file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;section name="loggingConfiguration"
               type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
               requirePermission="true" /&gt;
    &lt;/configSections&gt;
    &lt;loggingConfiguration name="logging" tracingEnabled="true" defaultCategory="General"&gt;
      &lt;listeners&gt;
        &lt;add name="Console Trace Listener" 
             listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.SystemDiagnosticsTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             formatter="Simple Formatter"
             type="test.TestTraceListener, test"
             traceOutputOptions="DateTime, Timestamp, ThreadId" /&gt;
      &lt;/listeners&gt;
      &lt;formatters&gt;
        &lt;add name="Simple Formatter"
             type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
             template="{timestamp(local:dd/MM/yy HH:mm:ss.fff)} [{severity}]: {message}" /&gt;
      &lt;/formatters&gt;
      &lt;categorySources&gt;
        &lt;add switchValue="Information" name="General"&gt;
          &lt;listeners&gt;
            &lt;add name="Console Trace Listener" /&gt;
          &lt;/listeners&gt;
        &lt;/add&gt;
      &lt;/categorySources&gt;
      &lt;specialSources&gt;
        &lt;allEvents switchValue="All" name="All Events" /&gt;
        &lt;notProcessed switchValue="All" name="Unprocessed Category" /&gt;
        &lt;errors switchValue="Warning" name="Logging Errors &amp;amp; Warnings" /&gt;
      &lt;/specialSources&gt;
    &lt;/loggingConfiguration&gt;
    &lt;startup&gt;
      &lt;supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" /&gt;
    &lt;/startup&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>If I understood correctly, my listener should have the "Simple Formatter" formatter that I declared in the configuration file in its <code>Formatter</code> property, but this is not the case.</p>
  
  <p>What am I missing?</p>