ASP.NET Tracing problems!

D

Dmitry Bond.

Hello All.

Could you plase help me to configure tracing in Asp.Net application.
I use Win2ksp4, .Net 1.1 (+ all latest patches for .Net 1.1 an for Windows).
I faced with stable error. On first access to the site it said:
===quote:begin===
Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.
Parser Error Message: Exception in configuration section handler.
Source Error:
Line 82: </appSettings>
Line 83:
Line 84: <system.diagnostics>
Line 85: <switches>
Line 86: <add name="traceLevel" value="0" />
Source File: c:\inetpub\wwwroot\AmbianceWebNH\web.config Line: 84
===quote:end===
 
D

Dmitry Bond.

sorry. I pressed Ctrl+Enter by mistake... :)

I give you more detail about the issue.
My web.config file contains lines:

<system.diagnostics>
<switches><add name="traceLevel" value="0" /></switches>
<trace autoflush="true" indentsize="4">
<listeners>
<add name="myListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="c:/Inetpub/wwwroot/MySite/log/_reports_trace.log"
/>
<remove type="System.Diagnostics.DefaultTraceListener"/>
</listeners>
</trace>
</system.diagnostics>

The line 84 is the line with "<system.diagnostics>".

What I want - I want to have nice tracing in my Asp.Net application.
Tracing that configured from web.config file and understands "~" in path to
log file.
For example:
<add name="myListener" type="System.Diagnostics.TextWriterTraceListener"
initializeData="~/log/_reports_trace.log" />
I mean - I do not wish to use physical path (because site location cound be
different on different servers).

Is it possible to do such thing in .Net 1.1 with standard stuff?
Or should I code my special TraceListener?

WBR,
Dmitry.


Dmitry Bond. said:
Hello All.
Could you plase help me to configure tracing in Asp.Net application.
[...]
 
D

Dmitry Bond.

Hello.

Finally I solved this problem by writing my own TraceListener that creates
TextWriter not at the moment of listener creation but on first access to it.
Also it does not stop whole site if unable to create trace log file (usually
by security reasons) and also it supports "~/" in path to trace log file.

WBR,
Dmitry.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top