title: AspNet Core Log4Net Proxy Syslog
body: <p>I'm using log4net in the net core app. But I can't figure out, how to send logs via http proxy. I've got a Remote syslog appender in my project.</p>
  <p>Any advice/direction how to set proxy would be much appreciated.</p>
  <pre><code>    public class Program
  {
      private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
      public static void Main(string[] args)
      {
          var webProxy = new WebProxy(&quot;http://my.proxy.com:8080&quot;);
          webProxy.UseDefaultCredentials = true;
  
          var logRepository = LogManager.GetRepository(Assembly.GetEntryAssembly());
          XmlConfigurator.Configure(logRepository, new FileInfo(&quot;log4net.config&quot;));
          log.Info(&quot;TEST&quot;);
      }
  }
  </code></pre>
  <p>log4net.config</p>
  <pre><code>&lt;log4net&gt;
      &lt;appender name=&quot;PapertrailRemoteSyslogAppender&quot; type=&quot;log4net.Appender.RemoteSyslogAppender&quot;&gt;
          &lt;facility value=&quot;Local6&quot; /&gt;
          &lt;identity value=&quot;%date{yyyy-MM-ddTHH:mm:ss.ffffffzzz} %P{log4net:HostName} MYSUPERAPP&quot; /&gt;
          &lt;layout type=&quot;log4net.Layout.PatternLayout&quot; value=&quot;%level - %message%newline&quot; /&gt;
          &lt;remoteAddress value=&quot;logs123.papertrailapp.com&quot; /&gt;
          &lt;remotePort value=&quot;123456&quot; /&gt;
      &lt;/appender&gt;
      &lt;root&gt;
          &lt;level value=&quot;INFO&quot; /&gt;
          &lt;appender-ref ref=&quot;PapertrailRemoteSyslogAppender&quot; /&gt;
      &lt;/root&gt;
  &lt;/log4net&gt;
  </code></pre>
  <p>csproj:</p>
  <pre><code>&lt;Project Sdk=&quot;Microsoft.NET.Sdk.Web&quot;&gt;
    &lt;PropertyGroup&gt;
      &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
      &lt;AssemblyName&gt;MySuperApp&lt;/AssemblyName&gt;
    &lt;/PropertyGroup&gt;
  
    &lt;ItemGroup&gt;
      &lt;PackageReference Include=&quot;log4net&quot; Version=&quot;2.0.8&quot; /&gt;
    &lt;/ItemGroup&gt;
    &lt;ItemGroup&gt;
      &lt;Content Update=&quot;log4net.config&quot;&gt;
        &lt;CopyToOutputDirectory&gt;Always&lt;/CopyToOutputDirectory&gt;
      &lt;/Content&gt;
    &lt;/ItemGroup&gt;
  &lt;/Project&gt;
  </code></pre>