Can WCF Logging be configured to use shell folder paths?

We are trying to configure WCF message logging and tracing on one of the paths to the shell folder. For example ..% ALLUSERSPROFILE% \ CompanyName \ logs \ ServiceTrace.svclog If I enter the full path to this place, it works, if I enter above, nothing appears. (I previously created the directories)

An example of a configuration fragment:

<source name="System.ServiceModel" switchValue="Verbose" propagateActivity="true">
    <listeners>
     <add type="System.Diagnostics.DefaultTraceListener" name="Default">
     <filter type="" />
     </add>
     <add initializeData="%ALLUSERSPROFILE%\Company Name\logs\ServiceTrace.svclog"
      type="System.Diagnostics.XmlWriterTraceListener" name="ServiceTrace"
      traceOutputOptions="None">
     <filter type="" />
     </add>
    </listeners>
  </source>

Any ideas are welcome.

+3
source share
1 answer

.NET trace listeners do not extend environment variables. You can probably find an extended version of tracelistenders or wrappers for the standard tracelisteners that do the extension.

, WCF, tracelisteners.

+2

Source: https://habr.com/ru/post/1765019/


All Articles