Home All Groups Group Topic Archive Search About

Trace Listener LogFilename not working

Author
16 Aug 2006 4:21 PM
Tim Johnson
I'm using .Net v1.1 and trying to use a TraceListener to write to a file. 
I've done a #define Trace so extra listeners will work, as documented.  My
customFileListener just inherits from DefaultTraceListener and sets the
base.LogFileName to a file.  Then my custom code overrides Write and
WriteLine by simply calling base.Write and base.WriteLine.  My app code adds
the customFileListener then just calls Trace.WriteLine.  But what I get is
just double entries in the Debug output window (I haven't removed the default
listener so both are active), instead of 1 set in Debug and 1 set in my file.

Is this just a 1.1 bug, or am I doing something dumb here?

AddThis Social Bookmark Button