Marc,
If you want to flush the contents of the trace to the file, then yes,
you do. And no, Close is not useful for garbage collection, as the
instances are not released.
In your windows service, you should probably call it when the service
shuts down, and when it pauses.
If you call Close, and you initialized the text file trace listener with
a filename, then it will reopen the file and write to it when another call
to Trace is made. If you pass a stream, then the stream is closed, and it
doesn't write to the stream again.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Marc" <Ma**@discussions.microsoft.comwrote in message
news:F4**********************************@microsof t.com...
I'm building a Windows service that writes log messages via
TraceListeners.
I assume Trace.Close() is useful for garbage collection, but I'm not sure
where to call it in the Windows service. Any thoughts?