{"id":5248,"date":"2017-01-03T00:21:39","date_gmt":"2017-01-02T22:21:39","guid":{"rendered":"https:\/\/www.limilabs.com\/blog\/?p=5248"},"modified":"2017-01-03T00:23:11","modified_gmt":"2017-01-02T22:23:11","slug":"how-to-log-system-net","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/how-to-log-system-net","title":{"rendered":"How to log System.Net"},"content":{"rendered":"<p>In your App.config add the following code:<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;?xml version=&quot;1.0&quot;?&gt;\r\n&lt;configuration&gt;\r\n  &lt;system.diagnostics&gt;\r\n\r\n    &lt;trace autoflush=&quot;true&quot;\/&gt;\r\n\r\n    &lt;switches&gt;\r\n      &lt;add name=&quot;System.Net&quot; value=&quot;Verbose&quot; \/&gt;\r\n    &lt;\/switches&gt;\r\n\r\n    &lt;sources&gt;\r\n      \r\n      &lt;source name=&quot;System.Net&quot;&gt;\r\n        &lt;listeners&gt;\r\n          &lt;add name=&quot;SystemNetLogFile&quot;\/&gt;\r\n        &lt;\/listeners&gt;\r\n      &lt;\/source&gt;\r\n      \r\n    &lt;\/sources&gt;\r\n\r\n    &lt;sharedListeners&gt;\r\n      &lt;add name=&quot;SystemNetLogFile&quot; type=&quot;System.Diagnostics.TextWriterTraceListener&quot; initializeData=&quot;d:\\system.net.log&quot;\/&gt;\r\n    &lt;\/sharedListeners&gt;\r\n\r\n  &lt;\/system.diagnostics&gt;\r\n&lt;\/configuration&gt;\r\n<\/pre>\n<p>That&#8217;s it!<\/p>\n<p>The log looks like this:<\/p>\n<p><code>System.Net Information: 0 : [8548] SecureChannel#238379<br \/>\nSystem.Net Information: 0 : [8548] Enumerating security<br \/>\nSystem.Net Information: 0 : [8548]     Negotiate<br \/>\nSystem.Net Information: 0 : [8548]     NegoExtender<br \/>\nSystem.Net Information: 0 : [8548]     pku2u<br \/>\nSystem.Net Information: 0 : [8548]     WDigest<br \/>\nSystem.Net Information: 0 : [8548]     Kerberos<br \/>\nSystem.Net Information: 0 : [8548]     NTLM<br \/>\nSystem.Net Information: 0 : [8548]     Schannel<br \/>\nSystem.Net Information: 0 : [8548]     Microsoft Unifie<br \/>\nSystem.Net Information: 0 : [8548]     TSSSP<br \/>\nSystem.Net Information: 0 : [8548]     CREDSSP<br \/>\nSystem.Net Information: 0 : [8548] SecureChannel#238379<br \/>\nSystem.Net Information: 0 : [8548] Current OS installat<br \/>\nSystem.Net Information: 0 : [8548] AcquireCredentialsHa<br \/>\nSystem.Net Error: 0 : [8548] AcquireCredentialsHandle()<br \/>\nSystem.Net Information: 0 : [8548] AcquireCredentialsHa<br \/>\nSystem.Net Error: 0 : [8548] AcquireCredentialsHandle()<br \/>\nSystem.Net Information: 0 : [8548] SecureChannel#214541<br \/>\nSystem.Net Information: 0 : [8548] SecureChannel#214541<br \/>\nSystem.Net Information: 0 : [8548] AcquireCredentialsHa<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] InitializeSecurityCo<br \/>\nSystem.Net Information: 0 : [8548] Remote certificate:<br \/>\n  V3<\/p>\n<p>[Subject]<br \/>\n  CN=mail.postecert.it, O=Postecom S.p.A., L=Roma, S=Ro<br \/>\n  Simple Name: mail.postecert.it<br \/>\n  DNS Name: mail.postecert.it<\/p>\n<p>[Issuer]<br \/>\n  CN=GlobalSign Organization Validation CA - SHA256 - G<br \/>\n  Simple Name: GlobalSign Organization Validation CA -<br \/>\n  DNS Name: GlobalSign Organization Validation CA - SHA<\/p>\n<p>[Serial Number]<br \/>\n  0A9141CFE287B47FF4273C12<\/p>\n<p>[Not Before]<br \/>\n  2016-11-02 08:01:04<\/p>\n<p>[Not After]<br \/>\n  2017-11-03 08:01:04<\/p>\n<p>[Thumbprint]<br \/>\n  F12F74096659D9CCAA4ACD3432C896AF39CA8B9E<\/p>\n<p>[Signature Algorithm]<br \/>\n  sha256RSA(1.2.840.113549.1.1.11)<\/p>\n<p>[Public Key]<br \/>\n  Algorithm: RSA<br \/>\n  Length: 2048<br \/>\n  Key Blob: 30 82 01 0a 02 82 01 01 00 bf a1 62 b7 64 1<br \/>\nSystem.Net Information: 0 : [8548] SecureChannel#214541<br \/>\nSystem.Net Information: 0 : [8548] ProcessAuthenticatio<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In your App.config add the following code: &lt;?xml version=&quot;1.0&quot;?&gt; &lt;configuration&gt; &lt;system.diagnostics&gt; &lt;trace autoflush=&quot;true&quot;\/&gt; &lt;switches&gt; &lt;add name=&quot;System.Net&quot; value=&quot;Verbose&quot; \/&gt; &lt;\/switches&gt; &lt;sources&gt; &lt;source name=&quot;System.Net&quot;&gt; &lt;listeners&gt; &lt;add name=&quot;SystemNetLogFile&quot;\/&gt; &lt;\/listeners&gt; &lt;\/source&gt; &lt;\/sources&gt; &lt;sharedListeners&gt; &lt;add name=&quot;SystemNetLogFile&quot; type=&quot;System.Diagnostics.TextWriterTraceListener&quot; initializeData=&quot;d:\\system.net.log&quot;\/&gt; &lt;\/sharedListeners&gt; &lt;\/system.diagnostics&gt; &lt;\/configuration&gt; That&#8217;s it! The log looks like this: System.Net Information: 0 : [8548] SecureChannel#238379 System.Net Information: 0 : [8548] Enumerating [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[111],"class_list":["post-5248","post","type-post","status-publish","format-standard","hentry","category-programming","tag-logging"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/5248"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=5248"}],"version-history":[{"count":10,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/5248\/revisions"}],"predecessor-version":[{"id":5258,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/5248\/revisions\/5258"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=5248"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=5248"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=5248"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}