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.
web.config
<system.diagnostics> <trace autoflush="true" indentsize="4"> <listeners> <add name="trace.log" type="System.Diagnostics.TextWriterTraceListener" initializeData="Trace.log" /> </listeners> </trace> </system.diagnostics>
More information about logging
- https://identityserver.github.io/Documentation/docsv2/configuration/logging.html
- https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/SelfHost%20SeqEvents
- https://developers.de/blogs/armin_kalajdzija/archive/2016/09/23/how-to-audit-login-activity-in-identityserver3.aspx