initializeData value deleted when use EntLibConfig tool

Jun 12, 2009 at 2:45 PM

I have a trace listener derived from customtrace listener that we configure using the EntLibConfiguration Tool.  I need to specify the file name to log and have been told I need to do this by editing the XML directly.  Which works and I am doing as shown below

initializeData = "C:\Logs\ASCTClientTrace00-xml.svclog"

This works fine, but when another developer opens the config file using the EntLib tool, my initiailzeData values are blow away. 

How do I make this configurable so it can be set using the EntLibConfig tool?



Jun 15, 2009 at 4:15 AM

You can opt to just put the filename in the Attributes collection property of the custom tracelistener.  Your custom tracelistener now should have the constructor with the NameValueCollection parameter.

public CustomTraceListener(NameValueCollection attributes)


       fileName = attributes["fileName"];


The "fileName" key is based from the Key you used for the value of filename in the Attributes collection property.

The other way would be to modify the entlib source code so as to create design time support for your custom tracelistener which is so much more tedious as compared to the first suggestion.

Sarah Urmeneta
Global Technology & Solutions
Avande, Inc.