title: How to add ApplicationInsights Logging Provider in Framework Console App Using Autofac
body: <p>I am working on a .NET (full framework 4.7.1) console app that uses AutoFac for DI purposes.</p>
  <p>We are in the process of migrating slowly to .NET Core, and have switched to using the ILogger abstractions provided by Microsoft.Extensions.Logging.Abstractions.</p>
  <p>I have wired up ILogger&lt;&gt; and ILoggerFactory in AutoFac using the following</p>
  <pre><code>        private static void RegisterLogging(ContainerBuilder builder)
          {
              builder.RegisterType&lt;LoggerFactory&gt;().As&lt;ILoggerFactory&gt;().SingleInstance();
              builder.RegisterGeneric(typeof(Logger&lt;&gt;)).As(typeof(ILogger&lt;&gt;)).InstancePerDependency();
          }
  </code></pre>
  <p>This depends on Microsoft.Extensions.Logging - and it seems to be working.</p>
  <p>Now I want to wire up the Application Insights Logging provider, however all the documentation I can find only mentions how to add it to the .NET Core DI Container, and looking through the source code on various repos, I am a bit mystified on how to do it.</p>
  <p>I figured that I might be able to do it like this:
  <code>builder.RegisterType&lt;ApplicationInsightsLoggerProvider&gt;().As&lt;ILoggerProvider&gt;();</code></p>
  <p>But it depends on <code>IOptions&lt;TelemetryConfiguration&gt; telemetryConfigurationOptions</code> and  <code>IOptions&lt;ApplicationInsightsLoggerOptions&gt; applicationInsightsLoggerOptions</code> neither of which I have.</p>
  <p>Have anybody done this, or have suggestions on how to accomplish it?</p>