traceOutputOptions only works with formatter = Empty

Topics: Logging Application Block
Jul 16, 2007 at 4:29 PM

I'm using the 3.1 Logging Application Block and have noticed that the traceOutputOptions only works if I don't specify a formatter. Is this by design?

For example: If I set the traceOutputOptions = "Callstack", and I set the formatter = "", I do get the Callstack with Flat File Trace Listener. However, if I
set formatter = "Text Formatter" {which is Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter} I get no Callstack.

I have noticed the same behavior with Logging Application Block's Rolling Flat File Listener and Event Log Listener.

Any help would be appreciated.

Oct 26, 2007 at 6:20 PM
Could someone please elaborate as to why this is the case and how to properly use the feature?

Ive been searching as to why I couldnt get the "traceOutputOptions" to work as well and was able to duplicate the situation stated above.

I want to know is why I have to choose between specifying what to display (via textformatter {option}) and having the callstack etc? Is it intended to only be used for exception logging since they can be corellated to tracing or other logging which would then implement the textformatter?

--Id like to have both available (callstack and {options} supported by textformatter)... how about a {callstack} option ?
Oct 30, 2007 at 1:06 PM

Unfortunately, formatters and trace options are really mutually exclusive features; while there is some overlapping among them, some of the features available through trace output options are not provided by formatters.

The feature you request is sensible. However, it does require changing the ILogFormatter interface to supply the additional TraceEventCache holding the options, so it's not possible to just add an options aware formatter. I'll log this as a feature request.

Oct 30, 2007 at 1:07 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 27, 2008 at 4:21 PM
+1 on this request. Since Enterprise Library Logging builds upon the native trace features in .Net, features such as this shouldn't be blocked when using any new capabilities provided by the block. I would also add that the configuration should reflect the fact that the TraceOptions is a flag. Therefore, the configuration should allow you to specify combinations.