3

我收到错误。我无法理解导致错误的原因。UI 上也不例外。类别表具有值(信息、异常、调试、常规)。当发生所有事件失败错误时,CategoryLog 表中没有记录。有人可以帮我理解这个错误并修复它。

跟踪 LogSource“所有事件”失败。其他来源的处理将继续。
有关详细信息,请参阅下面的摘要信息。如果这个问题持续存在,
停止服务并检查配置文件是否存在类别和接收器配置中可能出现的错误。   
企业图书馆分发服务摘要:
========================================-->   
消息:时间戳:2014 年 11 月 4 日晚上 9:35:46  
消息:'一些消息'。

网络配置:-

<listeners>
  <add name="DatabaseTraceListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=6.0.0.0, Culture=neutral, PublicKeyToken=########"
      listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=6.0.0.0, Culture=neutral, PublicKeyToken=#######"
      databaseInstanceName="LoggingDatabase" writeLogStoredProcName="WriteLog"
      addCategoryStoredProcName="AddCategory" 
      formatter="Text Formatter"
      traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack" />
</listeners>

<formatters>
  <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=#####"
      template="Timestamp: {timestamp}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}"
      name="Text Formatter" />
</formatters>

<categorySources>
  <add switchValue="Error" name="Error">
    <listeners>
      <add name="DatabaseTraceListener" />
    </listeners>
  </add>
  <add switchValue="Information" name="Information">
    <listeners>
      <add name="DatabaseTraceListener" />
    </listeners>
  </add>
  <add switchValue="Warning" name="Warning">
    <listeners>
      <add name="DatabaseTraceListener" />
    </listeners>
  </add>
</categorySources>

<specialSources>
  <allEvents switchValue="All" name="All Events">
    <listeners>
      <add name="DatabaseTraceListener" />
    </listeners>
  </allEvents>
  <notProcessed switchValue="All" name="Unprocessed Category">
    <listeners>
      <add name="DatabaseTraceListener" />
    </listeners>
  </notProcessed>
  <errors switchValue="All" name="Logging Errors &amp; Warnings">
    <listeners>
      <add name="DatabaseTraceListener" />
    </listeners>
  </errors>
</specialSources>


日志表中的错误记录如下所示

LogID:  ######
EventID : 6352
Priority: -1
Severity: Error 
Title   : 
Timestamp:  2014-11-10 00:55:51.770

MachineName : ########

AppDomainName:  /LM/W3SVC/3/ROOT-######

ProcessID:  5272

ProcessName:    c:\windows\system32\inetsrv\w3wp.exe

ThreadName: NULL

Win32ThreadId:  8852

Message :Tracing to LogSource 'All Events' failed. Processing for other sources will continue. See summary information below for more information. Should this problem persist, stop the service and check the configuration file(s) for possible error(s) in the configuration of the categories and sinks.   Summary for Enterprise Library Distributor Service: 
====================================== -->   Message:   Timestamp: 

FormattedMessage :
4

2 回答 2

0

您在记录到数据库时遇到错误。但它似乎并不完全是灾难性的,因为似乎正在记录错误。这排除了常见原因,例如无效的连接字符串。

您需要找出实际错误是什么。为此,将错误特殊源更改为记录到文件(在具有适当权限的位置)。所以添加一个平面文件跟踪侦听器:

<listeners>
    <add name="DatabaseTraceListener" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=6.0.0.0, Culture=neutral, PublicKeyToken=########"
      listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=6.0.0.0, Culture=neutral, PublicKeyToken=#######"
      databaseInstanceName="LoggingDatabase" writeLogStoredProcName="WriteLog"
      addCategoryStoredProcName="AddCategory" 
      formatter="Text Formatter"
      traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId, Callstack" />
    <add name="Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        fileName="trace.log" />
</listeners>

然后将错误特殊源设置为使用平面文件跟踪侦听器:

  <specialSources>
    <allEvents switchValue="All" name="All Events">
      <listeners>
        <add name="DatabaseTraceListener" />
      </listeners>
    </allEvents>
    <notProcessed switchValue="All" name="Unprocessed Category">
      <listeners>
        <add name="DatabaseTraceListener" />
      </listeners>
    </notProcessed>
    <errors switchValue="All" name="Logging Errors &amp; Warnings">
      <listeners>
        <add name="Flat File Trace Listener" />
      </listeners>
    </errors>
  </specialSources>

使用该设置,您应该希望看到错误的完整详细信息。

于 2014-11-14T17:26:42.280 回答
0

让用户尝试以管理员身份写入日志是解决此问题的方法。也可以更改 UAC 设置以使 IIS 用户成为管理员。

于 2015-07-03T09:18:24.590 回答