EntLib 4.1 (Logging Block) on Windows 2008

Topics: Logging Application Block
Dec 3, 2008 at 1:48 AM
Edited Dec 3, 2008 at 6:19 PM
Hello,

I have a web service, host by IIS, that does some logging, e.g., Logger.Write("Hello", "Unhandled Exception");   For the logging configuration, I have a "Unhandled Exception" category that references "FlatFile TraceListener".  This trace listener is simply a flat file trace listener with default values, e.g. filter="All", Filename="trace.log", etc.  I am running under  64-bit Windows 2008 Web edition.  I installed EntLib 4.1 on the server and ran the InstallServices.bat as admin.

My problem is trace.log is not being generated.  There is no error message return; no event log messages, nothing at all.  If I move the service to my 64-bit Vista machine, the file is generated.

Here is the configuration.

  <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="Unhandled Exception" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add fileName="trace.log" header="----------------------------------------"
        footer="----------------------------------------" formatter="Text Formatter"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="FlatFile TraceListener" />
    </listeners>
    <formatters>
      <add template="&lt;Timestamp&gt;{timestamp}&lt;/Timestamp&gt;&#xD;&#xA;&lt;Message&gt;{message}&lt;/Message&gt;&#xD;&#xA;&lt;Category&gt;{category}&lt;/Category&gt;&#xD;&#xA;&lt;Priority&gt;{priority}&lt;/Priority&gt;&#xD;&#xA;&lt;EventId&gt;{eventid}&lt;/EventId&gt;&#xD;&#xA;&lt;Severity&gt;{severity}&lt;/Severity&gt;&#xD;&#xA;&lt;Title&gt;{title}&lt;/Title&gt;&#xD;&#xA;&lt;Machine&gt;{machine}&lt;/Machine&gt;&#xD;&#xA;&lt;ApplicationDomain&gt;{appDomain}&lt;/ApplicationDomain&gt;&#xD;&#xA;&lt;ProcessId&gt;{processId}&lt;/ProcessId&gt;&#xD;&#xA;&lt;ProcessName&gt;{processName}&lt;/ProcessName&gt;&#xD;&#xA;&lt;Win32ThreadId&gt;{win32ThreadId}&lt;/Win32ThreadId&gt;&#xD;&#xA;&lt;ThreadName&gt;{threadName}&lt;/ThreadName&gt;&#xD;&#xA;&lt;ExtendedProperties&gt;{dictionary(&#xD;&#xA;{tab}{key} - {value})}&#xD;&#xA;&lt;/ExtendedProperties&gt;&#xD;&#xA;"
        type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Text Formatter" />
    </formatters>
    <categorySources>
      <add switchValue="All" name="Unhandled Exception">
        <listeners>
          <add name="FlatFile TraceListener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events">
        <listeners>
          <add name="FlatFile TraceListener" />
        </listeners>
      </allEvents>
      <notProcessed switchValue="All" name="Unprocessed Category">
        <listeners>
          <add name="FlatFile TraceListener" />
        </listeners>
      </notProcessed>
      <errors switchValue="All" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="FlatFile TraceListener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>



TIA,
An
Dec 3, 2008 at 2:13 AM
If you're sure you have an exactly the same configuration settings in both environment, I suggest you investigate permissions. Try looking at the event log and see if there are any errors relating to permissions.


Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@avanade.com