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:
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:
Any suggestions? Where would the output log file be if one is not specified?
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:
Code:
public class DebugTextWriter : System.IO.TextWriter
{
public override void Write(char[] buffer, int index, int count)
{
HttpContext.Current.Response.Write("<textarea>" + new String(buffer, index, count) + "</textarea>");
}
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:
Code:
Applications.DebugTextWriter dbgTextwriter = new DebugTextWriter();
dbgTextwriter.Wriet("some message") ;
Any suggestions? Where would the output log file be if one is not specified?