Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / November 2004

Tip: Looking for answers? Try searching our database.

Trace not always writing to TextWriterTraceListener

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kirby Keim - 19 Oct 2004 16:08 GMT
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?
Kirby Keim - 19 Oct 2004 16:19 GMT
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.

> 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?
Dino Chiesa [Microsoft] - 03 Nov 2004 17:19 GMT
are you flushing?
it's good hygiene.

;)

Trace.Flush() ;

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

> Here is the dump of the attachment:
> <configuration>
[quoted text clipped - 26 lines]
>> From the debugger, I can tell that my TextWriterTraceListener is set
>> correctly.  Has anyone else experienced this problem?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.