Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

loging output to a file on the server side.

xarzuxarzu Posts: 8Member

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.