I am using .NET 2.0 tracing to log messages within my application and
app.config (<System.Diagnostics>) to configure it. I would like to be
able to configure tracing in a finer grained manner than it is
currently possibile out of the box. Especially I would like
1. the filnames where the traceevent end up to be dynamically generated
(e.g. based on date and the tracesource). This should be configurable
somewhere in the app.config by specifying a pattern (e.g.
"tracesourceName_yyyy-mm-dd.log").
2. a new file to be generated whenever the filesize of the current
logfile exceeds a certain size. This should also be configurable in the
app.config (i.e. filesize threshold or number of traceevents).
What would be a good way to implement this without too much reinventing
the wheel?
Chris Fulstow - 10 Oct 2006 09:10 GMT
You might be able to do this by building a wrapper for the
TextWriterTraceListener class?
> I am using .NET 2.0 tracing to log messages within my application and
> app.config (<System.Diagnostics>) to configure it. I would like to be
[quoted text clipped - 12 lines]
> What would be a good way to implement this without too much reinventing
> the wheel?
Markus - 10 Oct 2006 16:08 GMT
> What would be a good way to implement this without too much
> reinventing the wheel?
Have a look at Microsoft Enterprise Library, especially the Logging Block.
hth
Markus