A piece of my work around PowerShell and IIS (or usefull things I've found on the web). Mostly some reminders for myself!

You can enable tracing for an entire application in the Web.config file in the application’s root directory. By default, application-level tracing can be viewed only when accessing the website from the webserver browser; and that’s a good thing, you don’t want anyone be able to see your application’s trace!

  1. First thing to do is to enable tracing for the application by defining it in the Web.config file in the application’s root directory, like below:
  2.  
    
    <configuration>
    <system.web>
    <trace enabled="true" requestLimit="40" localOnly="false" />
    </system.web>
    </configuration>
    
    

    The trace options are:

    • enabled
    • true if tracing is enabled for the application; otherwise, false. The default is false.

    • pageOutput
    • true if trace information is displayed both on an application’s pages and in the .axd trace utility; otherwise, false. The default is false.
      Pages that have tracing enabled are not affected by this setting.

    • requestLimit
    • Number of trace requests to store on the server. The default is 10.

    • traceMode
    • Indicates whether trace information is displayed in the order in which it was processed (SortByTime) or alphabetically by user-defined category (SortByCategory). The default is SortByTime.

    • localOnly
    • true if the trace viewer (Trace.axd) is available only on the host Web server; otherwise, false. The default is true.

  3. Then browse the application and add ‘/trace.axd’ to the end of the URL
  4. For example, if the URL of the application is ‘http://localhost/Application’, the URL to trace will be ‘http://localhost/Application/trace.axd’

  5. Clear the current results that will be displayed.
  6. Refresh the trace page.

 
Or enable the trace directly in a specific page:

 

<%@ Page Language="VB" Trace="true" requestLimit="40" localOnly="false" %>

5 Comments
antonybalderas
antonybalderas

What’s up, I read your blogs on a regular basis. Your writing style is witty, keep doing what you’re doing!

Alberta
Alberta

just the thing which usually worked for for me

artand
artand

Man, nice post. Where can I find the websites feed?

Fab
Fab

Thanks. For the RSS feed, that’s right here: http://www.zerrouki.com/feed/

qysn
qysn

Hello first time to come to this blog, I like it very much!

Name*Email*WebsiteComment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top