G
Guest
I am using a TraceSource object configured via app.config. In order to delete
the old file before starting the new trace, I need to obtain the filename
from the listener. What am I doing wrong in the following sample:
Dim trc As New TraceSource("HappySource")
‘filename returns Nothing:
Dim filename As String = _
trc.Listeners.Item("myTextListener").Attributes("initializeData")
app.config part:
<sources>
<source name="HappySource" switchName="HappySwitch">
<listeners>
<add name="myTextListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="TextWriterOutput.txt"
traceOutputOptions="DateTime" />
<remove name="Default"/>
</listeners>
</source>
thank you very much. herbert
the old file before starting the new trace, I need to obtain the filename
from the listener. What am I doing wrong in the following sample:
Dim trc As New TraceSource("HappySource")
‘filename returns Nothing:
Dim filename As String = _
trc.Listeners.Item("myTextListener").Attributes("initializeData")
app.config part:
<sources>
<source name="HappySource" switchName="HappySwitch">
<listeners>
<add name="myTextListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="TextWriterOutput.txt"
traceOutputOptions="DateTime" />
<remove name="Default"/>
</listeners>
</source>
thank you very much. herbert