IIS / ASP.net error for failed request trace: "trace of failed request for this content already exists"

I am trying to add a Failed Request Tracing to my IIS 7 / ASP.NET server.

First, I create an unsuccessful request trace for " all content, error codes 400-999 " because I want to save all errors.

Then I try to create a trace for " all content, time: 5 seconds " because I want to keep track of all the "long" requests. However, IIS 7 gives me the error : "Failover request tracing for this content already exists."

How to add a second trace for all content that takes> 5 seconds?

alt text

+4
source share
1 answer

In web.config , the failed request trace configuration looks something like this:

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

The path attribute determines the type of content, that is, the parameters on the first page of the Add FRT Wizard (*, * .aspx, * .asp, Custom).

If you examine the system.webServer/tracing/traceFailedRequests in applicationHost.config (located in %systemroot%\System32\inetsrv\ config\schema\IIS_schema.xml , you will find the following restrictions:

Invalid request path must be unique:

 <attribute name="path" type="string" isUniqueKey ="true" /> 

On the way, each provider (ASP, ASPNET, ISAPI Extension, etc.) must be unique:

 <attribute name="provider" type="string" required="true" isUniqueKey="true" /> 

If you added another trace rule to trace the same content (*), but specifying timeTaken , you should 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, contradicts the rules in the scheme, which say that the path must be unique.

However, you can specify the specific content that you want to track when timeTaken > = up to 5 seconds.

For instance:

 <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 making a wildcard, but this is a workaround.

+1
source

Source: https://habr.com/ru/post/1332551/


All Articles