4

I want to reroute logging from System.Net to NLog:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.diagnostics>
    <sources>
      <source name="System.Net" switchValue="All">
        <listeners>
          <add name="nlog" />
        </listeners>
      </source>
      <source name="System.Net.Sockets" switchValue="All">
        <listeners>
          <add name="nlog" />
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add name="nlog" type="NLog.NLogTraceListener, NLog" />
    </sharedListeners>
  </system.diagnostics>
</configuration>

How can I make it work from code without any app.config/web.config files? I can't use them in Unity3D.

Vlad
  • 3,001
  • 1
  • 22
  • 52
  • 1
    Duplicate of https://stackoverflow.com/questions/1049442/system-net-httpwebrequest-tracing-without-using-files-or-app-config ? – Rolf Kristensen Sep 20 '17 at 21:34

0 Answers0