.NET Single Line Logging (ala Trace.Write/WriteLine) using Instrumentation.Logging
- by KnownColor
Hello Everyone,
My question is whether it is possible to get line/multiline (very unsure of correct term for this) behaviour of the Trace.Write and Trace.WriteLine methods but using the Microsoft Instrumentation Logging framework in .NET 2.0.
Desired Output
Hello World!
Oh Hai.
What I Currently Have
Trace.Write("Hello ");
Trace.WriteLine("World!");
Trace.Write("Oh Hai.");
I would prefer to use instrumentation to log rather than writing to a log file using Debug.Trace.
EDIT: By Instrumentation Logging I mean using a 'loggingConfiguration' block in my App.config and writing Log Entries using using Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(LogEntry logEntry);
Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=2.0.0.0 for example.
Ta,
KnownColor