Enterprise Library TraceListener to display logging messages inside app

196 views Asked by At

I am using the microsoft enterprise library 6 for a short time now. The formatted logging for example to a text file or to console works fine, but I am failing to find a way to display these log messages inside my windows-forms applications.

So what I want to do is to display exact the same formatted messages that I log with FlatFileTraceListener to a file, in a log window/text box inside a windows forms app.

as a workaround I initialized a

FormattedTextWriterTraceListener(TextWriter writer, string name, ILogFormatter formatter);

With a StringWriter as TextWriter and fire an event manually every time I log a message and then update the whole text box when the event is raised with the new text but this does not look like a clean solution.

Does anyone have a solution?

0

There are 0 answers