title: Custom / Nested XML settings in ServiceConfiguration.cscfg
body: <p>We're trying to implement some dynamically configurable logging into our Azure application and we're using the enterprise libraries to do so which works fine, however the xml required to facilitate this is more complex than the simple 'appSetting' style setting which the ServiceConfiguration.cscfg file seems to accept in that it requires nested xml nodes, </p>
  
  <p>e.g.</p>
  
  <pre><code>&lt;configSections&gt;
      &lt;section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" /&gt;
  &lt;/configSections&gt;
  </code></pre>
  
  <p>which is resolved by (forgive the formatting in this window please):</p>
  
  <pre><code>&lt;loggingConfiguration name="" tracingEnabled="true" defaultCategory="General"&gt;
      &lt;listeners&gt;
          &lt;add listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.CustomTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              type="OurSolution.Common.AzureDiagnosticTraceListener, Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
              name="AzureDiagnosticTraceListener" /&gt;
      &lt;/listeners&gt;
      &lt;formatters&gt;
          &lt;add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
              template="Timestamp: {timestamp}{newline}&amp;#xA;Message: {message}{newline}&amp;#xA;Category: {category}{newline}&amp;#xA;Priority: {priority}{newline}&amp;#xA;EventId: {eventid}{newline}&amp;#xA;Severity: {severity}{newline}&amp;#xA;Title:{title}{newline}&amp;#xA;Machine: {localMachine}{newline}&amp;#xA;App Domain: {localAppDomain}{newline}&amp;#xA;ProcessId: {localProcessId}{newline}&amp;#xA;Process Name: {localProcessName}{newline}&amp;#xA;Thread Name: {threadName}{newline}&amp;#xA;Win32 ThreadId:{win32ThreadId}{newline}&amp;#xA;Extended Properties: {dictionary({key} - {value}{newline})}"
              name="Text Formatter" /&gt;
      &lt;/formatters&gt;
      &lt;categorySources&gt;
          &lt;add switchValue="All" name="General"&gt;
              &lt;listeners&gt;
                  &lt;add name="AzureDiagnosticTraceListener" /&gt;
              &lt;/listeners&gt;
          &lt;/add&gt;
      &lt;/categorySources&gt;
  &lt;/loggingConfiguration&gt;
  </code></pre>
  
  <p>I can't see a way of fooling the ServiceDefinition or ServiceConfiguration files to accept this, although if I could I can see a way of telling the enterprise libraries to use the ServiceConfiguration file which I can do in app.config.</p>
  
  <p>Why we are trying to solve this is to allow us to dynamically adjust the settings for the logging, i.e. change from No logging to Verbose without having to do a redeploy, which is proving time consuming and impractical in our live application which has only recently gone live so may still have the odd bug present ;-)</p>
  
  <p>Any thoughts would be most gratefully received
  Regards
  Kindo Malay</p>