views:

299

answers:

1

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

A: 

Have you tried appending Environment.NewLine in your logging statements when needed?

Dillie-O
This is the default behaviour of it, it always writes entries onto a new line, what I would like is to be able to write an entry and (optionally) have it write the next entry after the previous on the same line.
KnownColor