Exception Handling Log not creating in server

Topics: Exception Handling Application Block
Feb 2, 2010 at 1:37 PM

Hi All,

I am new to Enterprise library 4.1, I tried to implement exception handling in my application whenever exception raise it will log a file "trace.log" under Log folder. In local Application Server and deployed to Local IIS server its working fine but when i move to the development server the log file were not created(exceptionpolicy is successfully executed).

Could anyone suggest how to resolve this problem?

Regards

GanBoo

Feb 2, 2010 at 1:59 PM

What is the os of your development server?  Could you check if you have permission in the folder where you are creating the log file?

 

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

Feb 2, 2010 at 5:24 PM

I am having this issue on Windows 7 and Windows Server 2003.  I set an abosolute path for the log file and gave erveryone full control over the folder but not log file was created.  I am wondering if I need to specify I_USR.

Do you still need to register an event source before you can log to the event log?

Thanks,

Mike

Feb 2, 2010 at 9:53 PM

My issues went away when I deleted my web.config and created a new one from scratch. I had been experimenting with encryption and apparently corrupted the file.

Mike

Feb 3, 2010 at 6:34 AM

Local System : OS Win XP, Application Server,.net Framework 3.5 and EntLib is install

Production Server: OS Win Server 2003, IIS 6.0,.net Framework 3.5 and the following dll are copied into bin folder

Microsoft.Practices.EnterpriseLibrary.Common.dll
Microsoft.Practices.EnterpriseLibrary.Common.dll.refresh
Microsoft.Practices.EnterpriseLibrary.Common.xml
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll.refresh
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll.refresh
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.xml
Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.xml
Microsoft.Practices.EnterpriseLibrary.Logging.dll
Microsoft.Practices.EnterpriseLibrary.Logging.dll.refresh
Microsoft.Practices.EnterpriseLibrary.Logging.xml
Microsoft.Practices.ObjectBuilder2.dll
Microsoft.Practices.ObjectBuilder2.dll.refresh
Microsoft.Practices.Unity.dll
Microsoft.Practices.Unity.dll.refresh

I also tried delete the existing web.config and created a new; still the problem persist. Here the sample code which i used in local and Production server.

App_Code\BasePage.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
public class BasePage : System.Web.UI.Page
{
public BasePage()
{
}
    protected override void OnError(EventArgs e)
    {
        bool test = false;
        base.OnError(e);
        Exception ex = Server.GetLastError().GetBaseException();
        test = ExceptionPolicy.HandleException(ex, "Global Exception Policy");
       Response.Redirect("~/DefaultErrorPage.aspx?Test=" + test);
    }
}

Default.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Error code
        DateTime dateTime;
        string str = "test";
        dateTime = Convert.ToDateTime(str);
    }
}

web.config

<?xml version="1.0"?>
<!--
    Note: As an alternative to hand editing this file you can use the
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in
    machine.config.comments usually located in
    \Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
  <configSections>
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="exceptionHandling" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration.ExceptionHandlingSettings, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
      <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
          <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
          <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
          <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
        </sectionGroup>
      </sectionGroup>
    </sectionGroup>
  </configSections>
  <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="General" logWarningsWhenNoCategoriesMatch="true">
    <listeners>
      <add fileName="Log\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="Global FlatFile TraceListener" />
      <add source="Enterprise Library Logging" formatter="Text Formatter"
        log="Application" machineName="" listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        name="Formatted EventLog TraceListener" />
    </listeners>
    <formatters>
      <add template="Timestamp: {timestamp}&#xD;&#xA;Message: {message}&#xD;&#xA;Category: {category}&#xD;&#xA;Priority: {priority}&#xD;&#xA;EventId: {eventid}&#xD;&#xA;Severity: {severity}&#xD;&#xA;Title:{title}&#xD;&#xA;Machine: {machine}&#xD;&#xA;Application Domain: {appDomain}&#xD;&#xA;Process Id: {processId}&#xD;&#xA;Process Name: {processName}&#xD;&#xA;Win32 Thread Id: {win32ThreadId}&#xD;&#xA;Thread Name: {threadName}&#xD;&#xA;Extended Properties: {dictionary({key} - {value}&#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="Global Category">
        <listeners>
          <add name="Global FlatFile TraceListener" />
        </listeners>
      </add>
      <add switchValue="All" name="General">
        <listeners>
          <add name="Formatted EventLog TraceListener" />
        </listeners>
      </add>
    </categorySources>
    <specialSources>
      <allEvents switchValue="All" name="All Events" />
      <notProcessed switchValue="All" name="Unprocessed Category" />
      <errors switchValue="All" name="Logging Errors &amp; Warnings">
        <listeners>
          <add name="Formatted EventLog TraceListener" />
        </listeners>
      </errors>
    </specialSources>
  </loggingConfiguration>
  <exceptionHandling>
    <exceptionPolicies>
      <add name="Global Exception Policy">
        <exceptionTypes>
          <add type="System.Exception, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
            postHandlingAction="NotifyRethrow" name="Exception">
            <exceptionHandlers>
              <add logCategory="Global Category" eventId="100" severity="Error"
                title="Enterprise Library Exception Handling" formatterType="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.TextExceptionFormatter, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                priority="0" useDefaultLogger="false" type="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.LoggingExceptionHandler, Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                name="Logging Handler" />
            </exceptionHandlers>
          </add>
        </exceptionTypes>
      </add>
    </exceptionPolicies>
  </exceptionHandling>
  <appSettings />
  <system.web>
    <!--
            Set compilation debug="true" to insert debugging
            symbols into the compiled page. Because this
            affects performance, set this value to true only
            during development.
        -->
    <compilation debug="true">
      <assemblies>
        <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
        <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration
            of the security authentication mode used by
            ASP.NET to identify an incoming user.
        -->
    <authentication mode="Windows" />
    <!--
            The <customErrors> section enables configuration
            of what to do if/when an unhandled error occurs
            during the execution of a request. Specifically,
            it enables developers to configure html error pages
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
    <pages>
      <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      </controls>
    </pages>
    <httpHandlers>
      <remove verb="*" path="*.asmx" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
  </system.web>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
        <providerOption name="CompilerVersion" value="v3.5" />
        <providerOption name="OptionInfer" value="true" />
        <providerOption name="WarnAsError" value="false" />
      </compiler>
    </compilers>
  </system.codedom>
  <!--
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <remove name="ScriptModule" />
      <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
      <remove name="WebServiceHandlerFactory-Integrated" />
      <remove name="ScriptHandlerFactory" />
      <remove name="ScriptHandlerFactoryAppServices" />
      <remove name="ScriptResource" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </handlers>
  </system.webServer>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

 Thanks

GanBoo

Feb 3, 2010 at 6:56 AM

Please check the event viewer to see if there was any exception which occurred while logging to the file.

 

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

Feb 8, 2010 at 5:03 AM

I don't have right to login to the server so i not able to verify. Alternative i tried to log the error in the Database it's working in both environment (Local/Dev).

One more information need to mention, previously the using stream writer to log a file in the particular folder the same location which i have used for EntLib exception log, in this case not logging.

Is there any configuration should be do in web.config?

Regards

GanBoo

 

Feb 8, 2010 at 5:41 AM

I forgot to ask, on which environment does the file trace listener fails?  You specified Log\trace.log for its FileName property, could you verify if the Log folder gets created?

 

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

Feb 8, 2010 at 7:29 AM

Local System : OS Win XP, Application Server,.net Framework 3.5 and EntLib is install

Production Server: OS Win Server 2003, IIS 6.0,.net Framework 3.5 and the corresponding dll are copied into bin folder

The Folder is created through EntLib but file not yet created.

 

Regards

GanBoo

Feb 8, 2010 at 7:37 AM
Edited Feb 8, 2010 at 7:58 AM

I was just asking if this is both occurring in your local system and in the production server.  I suppose the answer is yes then? :)  Since you said that it can log in the database, I suggest you modify your config to replace the Formatted EventLog Trace Listener defined under the Logging Errors and Warnings node with the Database Trace Listener.  Then check for any error log entry indicating why logging to the file failed.

 

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

Feb 8, 2010 at 10:20 AM

The Folder/File was created in the local server whereas in production server only the folder is created. I tried to log warning into the database but it doesn't log why file is not created. It created log in the database about the exception alone

Regards

GanBoo

Feb 9, 2010 at 5:28 AM

Hi,

Can you post the exception details that was logged?

Feb 9, 2010 at 8:27 AM

here is warning message log in the DB

 

Message:
HandlingInstanceID: bbd09628-8d97-4c29-a48a-cb74bfff6263  An exception of type 'System.FormatException' occurred and was caught.  ----------------------------------------------------------------------  02/09/2010 04:16:30  Type : System.FormatException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  Message : The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.  Source : mscorlib  Help link :   Data : System.Collections.ListDictionaryInternal  TargetSite : System.DateTime Parse(System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles)  Stack Trace :    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)     at System.Convert.ToDateTime(String value)     at VideoGame_UserPage.Page_Load(Object sender, EventArgs e) in \\production\www\game\UserPage.aspx.cs:line 65     at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)     at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)     at System.Web.UI.Control.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    Additional Info:    MachineName : ProdSystem TimeStamp : 2/9/2010 9:16:30 AM FullName : Microsoft.Practices.Enter
Formatted Message
Timestamp: 2/9/2010 9:16:30 AM Message: HandlingInstanceID: bbd09628-8d97-4c29-a48a-cb74bfff6263  An exception of type 'System.FormatException' occurred and was caught.  ----------------------------------------------------------------------  02/09/2010 04:16:30  Type : System.FormatException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  Message : The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.  Source : mscorlib  Help link :   Data : System.Collections.ListDictionaryInternal  TargetSite : System.DateTime Parse(System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles)  Stack Trace :    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)     at System.Convert.ToDateTime(String value)     at VideoGame_UserPage.Page_Load(Object sender, EventArgs e) in \\production\www\game\UserPage.aspx.cs:line 65     at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)     at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)     at System.Web.UI.Control.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    Additional Info:    MachineName : ProdSystem TimeStamp : 2/9/2010 9:16:30 AM FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 AppDomainName : /LM/W3SVC/893653892/ROOT-2-129101798363400338 ThreadIdentity :  WindowsIdentity : ProdSystem\DMZASPNET  Category: DB Category Priority: 0 EventId: 100 Severity: Warning Title:Enterprise Library Exception Handling Machine: ProdSystem Application Domain: /LM/W3SVC/893653892/ROOT-2-129101798363400338 Process Id: 5800 Process Name: c:\windows\system32\inetsrv\w3wp.exe Win32 Thread Id: 6016 Thread Name:  Extended Properties: 

Message:

 

HandlingInstanceID: bbd09628-8d97-4c29-a48a-cb74bfff6263  An exception of type 'System.FormatException' occurred and was caught.  ----------------------------------------------------------------------  02/09/2010 04:16:30  Type : System.FormatException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  Message : The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.  Source : mscorlib  Help link :   Data : System.Collections.ListDictionaryInternal  TargetSite : System.DateTime Parse(System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles)  Stack Trace :    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)     at System.Convert.ToDateTime(String value)     at VideoGame_UserPage.Page_Load(Object sender, EventArgs e) in \\production\www\game\UserPage.aspx.cs:line 65     at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)     at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)     at System.Web.UI.Control.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    Additional Info:    MachineName : ProdSystem TimeStamp : 2/9/2010 9:16:30 AM FullName : Microsoft.Practices.Enter

 

 

Formatted Message

 

Timestamp: 2/9/2010 9:16:30 AM Message: HandlingInstanceID: bbd09628-8d97-4c29-a48a-cb74bfff6263  An exception of type 'System.FormatException' occurred and was caught.  ----------------------------------------------------------------------  02/09/2010 04:16:30  Type : System.FormatException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089  Message : The string was not recognized as a valid DateTime. There is a unknown word starting at index 0.  Source : mscorlib  Help link :   Data : System.Collections.ListDictionaryInternal  TargetSite : System.DateTime Parse(System.String, System.Globalization.DateTimeFormatInfo, System.Globalization.DateTimeStyles)  Stack Trace :    at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)     at System.Convert.ToDateTime(String value)     at VideoGame_UserPage.Page_Load(Object sender, EventArgs e) in \\production\www\game\UserPage.aspx.cs:line 65     at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)     at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)     at System.Web.UI.Control.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    Additional Info:    MachineName : ProdSystem TimeStamp : 2/9/2010 9:16:30 AM FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=4.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 AppDomainName : /LM/W3SVC/893653892/ROOT-2-129101798363400338 ThreadIdentity :  WindowsIdentity : ProdSystem\DMZASPNET  Category: DB Category Priority: 0 EventId: 100 Severity: Warning Title:Enterprise Library Exception Handling Machine: ProdSystem Application Domain: /LM/W3SVC/893653892/ROOT-2-129101798363400338 Process Id: 5800 Process Name: c:\windows\system32\inetsrv\w3wp.exe Win32 Thread Id: 6016 Thread Name:  Extended Properties: 

 

In http://msdn.microsoft.com/en-us/library/dd140036.aspx#PT_Logging they mention about trust level of the application, whether because of trust the file not creating.....?

 

Feb 9, 2010 at 10:08 AM

It could be one possiblity. Can you try adding the permission required by the block in order to run on your trust level.

Feb 16, 2010 at 4:57 AM
Edited Feb 16, 2010 at 10:50 AM

I provided full control rights to the folder (master level) for the user "Everyone" in Security tab, even though in the server location the "ErrorLog" folder is created but log file is not created.

Could you please guide me how to add the permission in organize to archived the log file to be created?

Regards

GanBoo

<!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Normal</w:View> <w:Zoom>0</w:Zoom> <w:PunctuationKerning /> <w:ValidateAgainstSchemas /> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:Compatibility> <w:BreakWrappedTables /> <w:SnapToGridInCell /> <w:WrapTextWithPunct /> <w:UseAsianBreakRules /> <w:DontGrowAutofit /> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]--><!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --><!--[if gte mso 10]> <mce:style><! /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} --> <!--[endif]-->

Archived

Feb 16, 2010 at 8:33 AM

Could you first try this: Remove the Timestamp token in your formatter template and then try logging again.  See if the log file gets created.

 

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