Groups | Blog | Home
all groups > dotnet sdk > october 2004 >

dotnet sdk : Trace not always writing to TextWriterTraceListener


Kirby Keim
10/19/2004 11:08:25 AM
I am using the Trace.Write method to output debug statements throughout my
code. I have created the attached configuration file for settings.
However, more often than not, the messages are not being output to the file.
From the debugger, I can tell that my TextWriterTraceListener is set
correctly. Has anyone else experienced this problem?



begin 666 EP200.exe.config
M/&-O;F9I9W5R871I;VX^#0H@/'-Y<W1E;2YD:6%G;F]S=&EC<SX-"B @/"$M
M+2!C;VYF:6=U<F%T:6]N(&9O<B!L;V=G:6YG("TM/@T*(" \=')A8V4@875T
M;V9L=7-H/2)T<G5E(CX-"B @(#QL:7-T96YE<G,^#0H@(" @/"$M+2!3970@
M=&AE(&QO9R!F:6QE.B!I;FET:6%L:7IE1&%T82 ]('!A=&A<;F%M92 M+3X-
M"B @(" \861D(&YA;64](FQO9T9I;&4B('1Y<&4](E-Y<W1E;2Y$:6%G;F]S
M=&EC<RY497AT5W)I=&5R5')A8V5,:7-T96YE<B(@:6YI=&EA;&EZ941A=&$]
M(D50,C P+FQO9R(@+SX-"B @(#PO;&ES=&5N97)S/@T*(" \+W1R86-E/@T*
M(" \<W=I=&-H97,^#0H@(" \(2TM(%-E="!T:&4@=')A8V4@;&5V96P@:&5R
M93H@=F%L=64@," ](&]F9BP@,2 ](&5R<F]R+" R(#T@=V%R;FEN9RP@,R ]
M(&EN9F\L(#0@/2!V97)B;W-E("TM/@T*(" @/&%D9"!N86UE/2)'96YE<F%L
M(B!V86QU93TB-"(@+SX-"B @/"]S=VET8VAE<SX-"B \+W-Y<W1E;2YD:6%G
<;F]S=&EC<SX-"CPO8V]N9FEG=7)A=&EO;CX-"@``
`
end
Kirby Keim
10/19/2004 11:19:07 AM
Here is the dump of the attachment:
<configuration>
<system.diagnostics>
<!-- configuration for logging -->
<trace autoflush="true">
<listeners>
<!-- Set the log file: initializeData = path\name -->
<add name="logFile" type="System.Diagnostics.TextWriterTraceListener"
initializeData="EP200.log" />
</listeners>
</trace>
<switches>
<!-- Set the trace level here: value 0 = off, 1 = error, 2 = warning, 3 =
info, 4 = verbose -->
<add name="General" value="4" />
</switches>
</system.diagnostics>
</configuration>


This works fine once in a while, but most of the time when I restart the
application, no messages are written to the file.


[quoted text, click to view]

Dino Chiesa [Microsoft]
11/3/2004 10:19:22 AM
are you flushing?
it's good hygiene.

;)

Trace.Flush() ;

it could be just that the listener has buffered trace writes.


[quoted text, click to view]

AddThis Social Bookmark Button