title: How to configure Azure logging after upgrading to ASP.NET Core 2.2
body: <p>Are upgrading from ASP.NET Core 2.1 to ASP.NET Core 2.2 and following <a href="https://docs.microsoft.com/en-us/aspnet/core/migration/21-to-22?view=aspnetcore-2.2&amp;tabs=visual-studio" rel="noreferrer">the official documentation guide</a>.</p>
  
  <p>Got a problem with writing the new logging configuration in <strong>Startup.cs</strong>. Specifically problems on how to handle the <em>AzureWebAppDiagnostics</em>.</p>
  
  <p>The old configuration consisted of the following configuration:</p>
  
  <pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
  {
      ...
      loggerFactory.AddApplicationInsights(app.ApplicationServices);
      loggerFactory.AddAzureWebAppDiagnostics(
          new AzureAppServicesDiagnosticsSettings
          {
              OutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss zzz} [{Level}] {RequestId}-{SourceContext}: {Message}{NewLine}{Exception}"
          }
      );
  }
  </code></pre>
  
  <p>Both the <em>AddAzureWebAppDiagnostics</em> and the <em>AzureAppServicesDiganosticsSettings</em> is marked as obsolete. The later suggests to use <em>AzureBlobLoggerOptions</em> instead. The guide states that the logging config should be moved to something like this:</p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      ...
      services.AddLogging(builder =&gt; builder
          .AddConsole()
          .AddAzureWebAppDiagnostics());
      ...
  }
  </code></pre>
  
  <p>However I have no clue on how to properly add the configuration to the ILoggingBuildler AND as an extra bonus, the <em>AzureBlobLoggerOptions</em> does no allow for a custom OutputTemplate. The <em>AddApplicationInsights</em> is also missing from the ILoggingBuilder.</p>
  
  <p>Any suggestions on how to get this working like it used to be?</p>