Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To enable generation of a trace file for Identity Server 3, insert the following in web.config file. If <system.diagnostics> is not already present in the file, insert the section between the sections <appSettings> and <system.web>. To disable the trace later, it'll suffice to comment out the <add> element.


Code Block
languagexml
firstline19
titleweb.config
  <system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add name="trace.-log" type="System.Diagnostics.TextWriterTraceListener" initializeData="Trace.log" />
      </listeners>
    </trace>
  </system.diagnostics>


The initializeData attribute in the <add> element points to the trace file. When no path is specified, the file is created in the web site folder which may be inappropriate and can be a security risk.

Consider a better place and be aware that the application pool identity must have write access to the folder (which, in fact, it may not have to the web site folder).


More information about logging

...