ASU Web Community

ASU.Web.TraceWriter.1.0.0.0

Summary

The ASU.Web.TraceWriter assembly is designed to gather Trace output from your application and write it to a text file, so that you have a method of viewing trace output from the .NET production servers. The ASU.Web.TraceWriter will prepend the users IP Address and current date time to each trace message.

Current production version is 1.0.0.0, and is available for checkout from:
The entire project can be checked out from: https://svn.asu.edu/svn/webcommune/.net/asu.web.tracewriter/1.0.0.0/tags/prod-03-20-2008
Check out just the assembly from: https://svn.asu.edu/svn/webcommune/.net/asu.web.tracewriter/1.0.0.0/tags/prod-03-20-2008/ASU.Web.TraceWriter.1.0.0.0/bin/Release/ASU.Web.TraceWriter.1.0.0.0.dll

If you wish to expand on the ASU.Web.TraceWriter assembly please check it out from: https://svn.asu.edu/svn/webcommune/.net/asu.web.tracewriter/1.0.0.0/trunk

You must be a member of the ASU Web Developer Commune group to get access to this project.



Configuration

All configuration options for ASU.Web.TraceWriter assembly reside inside your web application's web.config file. Here is a listing of all configuration properties:

  • <appSettings>
  •   <add key="TraceFileMaxSize" value="524288" />
  •   <add key="TraceFileMaxFiles" value="9" />
  • </appSettings>

General Properties

TraceFileMaxSize (optional, default=524288 (5 meg))
Set this to the maximum size you want each trace log to be.

TraceFileMaxFiles (optional, default=9 (10 total files))
Set this to the maximum number of files you want created. When the maximum number is reached the ASU.Web.TraceWriter will start overwritting files starting with the oldest first.

System Diagnostics Settings

  • <system.diagnostics>
  •   <trace>
  •     <listeners>
  •       <add name="CustomListener" type="ASU.Web.TraceWriter.FileRollerTraceListener, ASU.Web.TraceWriter.1.0.0.0" initializeData="c:\logs\[Application Name].log" />
  •       <remove name="Default"/>
  •     </listeners>
  •   </trace>
  • </system.diagnostics>

You need to add the exact system.diagnostics section show above to you web.config file for ASU.Web.TraceWriter to function correctly. You should replace the [Application Name] in the initializeData parameter with a unique name for your application. The .NET server name will be appended to that name so that in the production environment you will end up with a file for each server in the farm.

Trace Settings

  • <trace enabled="true" writeToDiagnosticsTrace="true"/>

In order for the ASU.Web.TraceWriter assembly to be able to capture the trace output from you application it is necessary to have the trace configuration setting shown above in you application's web.config file.