Enable WCF logging on the fly

Lwelch45

New Member
Is there a way to enable/disable wcf logging on the fly by modifying and reloading the app.config? I would like to be able to toggle it within my application to facilitate the design of scenarios (and the logging of the associated messages) in order to use them later in load tests.

I've read before that IIS had to reload the app pool if the web.config is modified, but my project has none, the wcf layer is completely coded and the WCF logging is enabled in the app.config, using the standard snippets available on MSDN:\[code\]<system.diagnostics > <sources> <source name="System.ServiceModel.MessageLogging" switchValue="http://stackoverflow.com/questions/12781968/Information, ActivityTracing" > <listeners> <add name="yourTrace" type="System.Diagnostics.XmlWriterTraceListener" initializeData="http://stackoverflow.com/questions/12781968/C:/Users/rfr/Desktop/Logs/YourMessageLog.svclog"> <filter type="" /> </add> </listeners> </source></sources><trace autoflush="true" /></system.diagnostics><system.serviceModel> <diagnostics> <messageLogging logMessagesAtTransportLevel="false" logMessagesAtServiceLevel="true" logMalformedMessages="true" logEntireMessage="true" maxSizeOfMessageToLog="65535000" maxMessagesToLog="5000" /> </diagnostics></system.serviceModel>\[/code\]I guess changing the diagnostics keys to false would turn off the logging. Anyone here has insight on how to do it properly?
 
Back
Top