IIS/ASP.net错误,用于失败的请求跟踪:“此内容的失败请求跟踪已存在". [英] IIS/ASP.net error for failed request tracing: "a failed request trace for this content already exists"
问题描述
我正在尝试将失败的请求跟踪添加到我的IIS 7/ASP.NET服务器.
I am trying to add Failed Request Tracing to my IIS 7/ASP.NET server.
首先,由于要保存所有错误,因此我为"all content, error codes 400-999
"创建失败的请求跟踪.
First, I create failed request tracing for "all content, error codes 400-999
" because want to save all errors.
然后,我尝试为"all content, time: 5 seconds
"创建跟踪,因为我想跟踪所有长"请求.但是,IIS 7给我一个错误:此内容的失败请求跟踪已存在".
Then, I try to create a trace for "all content, time: 5 seconds
" because I want to trace all "long" requests. However, IIS 7 gives me an error: "A failed request trace for this content already exists".
如何为所有耗时超过5秒的内容添加第二条跟踪记录?
How can I add this second trace for all content that takes > 5 seconds?
推荐答案
在您的web.config
中,失败的请求跟踪"配置类似于:
In your web.config
the Failed Request Tracing config looks something like:
<tracing>
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure, etc" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication, etc" verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="400-999" />
</add>
</traceFailedRequests>
</tracing>
属性path
定义了内容类型,即添加FRT"向导第一页中的选项(*,*.aspx,*.asp,自定义).
The attribute path
defines the content type i.e. the options in the first page of the Add FRT wizard (*, *.aspx, *.asp, Custom).
如果检查applicationHost.config
中位于%systemroot%\System32\inetsrv\
config\schema\IIS_schema.xml
的system.webServer/tracing/traceFailedRequests
部分的架构,则会发现以下约束:
If you examine the schema for the system.webServer/tracing/traceFailedRequests
section in applicationHost.config
(located in %systemroot%\System32\inetsrv\
config\schema\IIS_schema.xml
you'll find the following constraints:
失败的请求路径必须是唯一的:
The failed request path must be unique:
<attribute name="path" type="string" isUniqueKey ="true" />
在路径中,每个提供程序(ASP,ASPNET,ISAPI扩展等)必须是唯一的:
Within a path each provider (ASP, ASPNET, ISAPI Extension etc) must be unique:
<attribute name="provider" type="string" required="true" isUniqueKey="true" />
如果您添加了另一个跟踪规则以跟踪相同的内容(*)但指定了timeTaken
,则您将尝试添加:
If you added another trace rule to trace the same content (*) but specifying timeTaken
then you'd be trying to add:
<add path="*">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure, etc" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication, etc" verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="400-999" />
</add>
这当然与架构中的规则冲突,后者指出路径必须是唯一的.
This of course conflicts with the rules in the schema which say that the path must be unique.
但是,您可以做的是指定要在timeTaken
> =到5秒之间跟踪的特定内容.
However what you can do is specify specific content that you want to trace when the timeTaken
is >= to 5 seconds.
例如:
<add path="*.aspx">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure, etc" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication, etc" verbosity="Verbose" />
</traceAreas>
<failureDefinitions timeTaken="00:00:05" statusCodes="400-999" />
</add>
<add path="*.asp">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure, etc" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication, etc" verbosity="Verbose" />
</traceAreas>
<failureDefinitions timeTaken="00:00:05" statusCodes="400-999" />
</add>
<add path="*.asmx">
<traceAreas>
<add provider="ASP" verbosity="Verbose" />
<add provider="ASPNET" areas="Infrastructure, etc" verbosity="Verbose" />
<add provider="ISAPI Extension" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication, etc" verbosity="Verbose" />
</traceAreas>
<failureDefinitions timeTaken="00:00:05" statusCodes="400-999" />
</add>
不像只能使用通配符那样方便,但这是一种解决方法.
Not as convenient as just being able to do a wildcard but it is a workaround.
这篇关于IIS/ASP.net错误,用于失败的请求跟踪:“此内容的失败请求跟踪已存在".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!