gpt4 book ai didi

web-services - 跟踪到 LogSource 'All Events' 失败。企业库日志记录错误

转载 作者:行者123 更新时间:2023-12-04 19:38:13 30 4
gpt4 key购买 nike

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

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: 11/4/2014 9:35:46 PM  Message: 'Some message'.

WebConfig:-

<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 :

最佳答案

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

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

<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>

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

关于web-services - 跟踪到 LogSource 'All Events' 失败。企业库日志记录错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26854699/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com