Use only the page trace of log4net and Asp.net. Recently, SSO failed to use CAS and found that its log was not output to the file. It took some time to add the following configuration to Web. config:
Note: The Source Name must match the full log name, and cannot be automatically matched with the namespace level in the same way as log4net.
< System. Diagnostics >
< Sources >
< Source Name = "Dotnetcasclient. httpmodule" Switchvalue = "All" Switchtype = "System. Diagnostics. sourceswitch" >
< Listeners >
< Add Name = "XML" />
</ Listeners >
</ Source >
</ Sources >
< Sharedlisteners >
< Add Name = "XML" Type = "System. Diagnostics. xmlwritertracelistener" Initializedata = "C: \ temp \ traces. svclog" />
< Add Name = "Console" Type = "System. Diagnostics. leletracelistener" />
</ Sharedlisteners >
< Trace Autoflush = "True" />
</ System. Diagnostics >