I am trying to add Failed Request Tracing to my IIS 7/ASP.NET server.
First, I create failed request tracing for "all content, error codes 400-999
" because want to save all errors.
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".
How can I add this second trace for all content that takes > 5 seconds?
In your
web.config
the Failed Request Tracing config looks something like:The attribute
path
defines the content type i.e. the options in the first page of the Add FRT wizard (*, *.aspx, *.asp, Custom).If you examine the schema for the
system.webServer/tracing/traceFailedRequests
section inapplicationHost.config
(located in%systemroot%\System32\inetsrv\ config\schema\IIS_schema.xml
you'll find the following constraints:The failed request path must be unique:
Within a path each provider (ASP, ASPNET, ISAPI Extension etc) must be unique:
If you added another trace rule to trace the same content (*) but specifying
timeTaken
then you'd be trying to add:This of course conflicts with the rules in the schema which say that the path must be unique.
However what you can do is specify specific content that you want to trace when the
timeTaken
is >= to 5 seconds.For example:
Not as convenient as just being able to do a wildcard but it is a workaround.