System.Diagnostics.Trace

    Date: 09/20/05 (C Sharp)    Keywords: no keywords

    When using System.Diagnostics.Trace to well...trace, what is the best way to make sure that TextWriterTraceListeners get closed? I saw in a few examples that you can call Trace.Close(), but then it seems like you'd have to either use a finalizer or else re-open and then close the Trace each time you needed it.

    The reason I ask is because I'm using trace to a little bit of simple logging to a flatfile, and I can only seem to use the flatfile once, because the next time I try to open it, it fails because the file is in use by another process. Any general tips\best practices when using Trace would be appreciated.

    Source: http://www.livejournal.com/community/csharp/35290.html

« Is there a C# equivalent to... || Controls Size property »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home