J
Jeremy S.
I'm implementing logging via the TraceSource class and related TraceSwitch
and TraceListeners classes.
The TextWriterTraceListener does much of what I need. But it does not roll
the log over at some max size, and is missing a couple of other feaures.
It appears that I have two options for getting the behavior I want:
1. Extend the TextWriterTraceListener (it isn't sealed), adding the features
I want in my derived class.
2. Write my own custom trace listener, extending the base TraceListener
class. I would then proceed to duplicate basically all of the functionality
in the TextWriterTraceListener and add the new functionality I want.
My tendency is to go with #1 above and extend the existing
TextWriterTraceListener class.
Are there any good reasons to NOT do that? Would it be better for me to
write a new class instead? (and yes, I'm aware of log4net, but don't want to
go that route for now).
I appreciate your thoughts on this.
and TraceListeners classes.
The TextWriterTraceListener does much of what I need. But it does not roll
the log over at some max size, and is missing a couple of other feaures.
It appears that I have two options for getting the behavior I want:
1. Extend the TextWriterTraceListener (it isn't sealed), adding the features
I want in my derived class.
2. Write my own custom trace listener, extending the base TraceListener
class. I would then proceed to duplicate basically all of the functionality
in the TextWriterTraceListener and add the new functionality I want.
My tendency is to go with #1 above and extend the existing
TextWriterTraceListener class.
Are there any good reasons to NOT do that? Would it be better for me to
write a new class instead? (and yes, I'm aware of log4net, but don't want to
go that route for now).
I appreciate your thoughts on this.