4
The trace
element in the web.config file this lets you capture trace information without
admitting text in each page that is served to the browser is a really useful
technique for tracking data inconsistencies monitoring flow through the
generation of the page and asserting conditions on applications already
deployed in a production environment.
And
the best part is because you're making the change within web.config you have to
change any of your pages or recompile the code C use the trace element in
web.config and that's what controls application level tracing down most trace
settings are configured in the web.config file in the examples that I'm to be
showing you require a lot of different changes to the web.config file to make
this a little bit easier.
The sample project has several different
config files with descriptive names for each demonstration you can copy and
paste the settings from the appropriate config file or you can just rename the
files so you have different web.config files affecting the different demos and
by the way we've also removed a lot of the standard default settings from the
configuration files in the sample is to make a little bit easier to see the
changes in a real application.
You usually want to leave all that the
treatise that Visual Studio includes in the initial web.config file at least
until you have a feel for what is required and what is not as awful as Stefan
that you really don't need to include as long as you're not changing default
settings if you want to turn on tracing for an entire application need to add
or edit the trace section in the applications web.config file setting elements
enabled attribute to true as a default is false as an example trace element
that you might have within a web.config file the enabled attribute indicates.
Whether tracing is turned on or off
that's a really useful feature because you can define tracing leave all the
other attributes in there and when you don't want to trace anymore all you have
to do is change enabled false and the page. Providing trace information that
because he's a comeback and have all the same setting set and just renewable it
to true the local only setting indicates that the trace viewer trace.txt is
available only on the host Web server by far the way most the time you want to
leave the set to true because if it's false the trace here is available from
any computer in any user.
That uses this application if it's on a
production server is going to be a lessee trace information not a good thing
the page output option indicates whether trace output is rendered at the end of
each page if you're using application level tracing the public want the
information rendered in a separate page to the default setting is false for
this option request limit is the number of requests to save on the server the
default is 10 and the maximum is 10,000 any valid integer value.
0 comments:
Post a Comment