Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


loging output to a file on the server side.

Bill Menke ThompsonBill Menke Thompson Member Posts: 8

I would like to have some way of tracing an ASP.NET application in production that is no longer in debug mode. I suppose I can try with some sort of pop-up windows, but, before I give that a try, I want to try to implement some way of the code writing out content on the server into a log file.

The code that I have inherited from a developer that is no longer with us, has an existing class that seems to be designed for this purpose:

public class DebugTextWriter : System.IO.TextWriter
public override void Write(char[] buffer, int index, int count)
HttpContext.Current.Response.Write("" + new String(buffer, index, count) + "");


    public override void Write(string value)
        HttpContext.Current.Response.Write("<textarea>" + value + "</textarea>");

    public override Encoding Encoding
        get { return System.Text.Encoding.Default; }

This does not seem to do much of anything to me. Where is the code written to?

When I look at the bit of code that implements this class, I do not see a file referenced:

Applications.DebugTextWriter dbgTextwriter = new DebugTextWriter();
dbgTextwriter.Wriet("some message") ;

Any suggestions? Where would the output log file be if one is not specified?

Sign In or Register to comment.