title: Using Serilog for Logging with Azure Table Storage in .NET Core MVC
body: <p>Despite hours spent on google, I am not getting there.  We have a Core 3.1 MVC Web App project, and I've been asked to use SeriLog to write logs to Azure Table Storage.  For the life of me, I can't find a working example or tutorial online. Here's what I've done so far:</p>
  
  <p>1) Added the following NuGet's:</p>
  
  <ul>
  <li>Serilog</li>
  <li>Serilog.Extensions.Logging</li>
  <li>Serilog.Sinks.AzureTaleStorage</li>
  </ul>
  
  <p>2) In AppSettings.json, replaced this:</p>
  
  <pre><code>  "Logging": {
      "LogLevel": {
        "Default": "Information",
        "Microsoft": "Information",
        "Microsoft.Hosting.Lifetime": "Warning"
      }
  </code></pre>
  
  <p>With this:</p>
  
  <pre><code>  "Serilog": {
      "WriteTo": [
        {
          "Name": "AzureTableStorage",
          "Args": {
            "storageTableName": "Logs",
            "connectionString": "DefaultEndpointsProtocol=https;AccountName=***;AccountKey=***;EndpointSuffix=core.windows.net"
          }
        }
      ]
    },
  </code></pre>
  
  <p>And now I am stuck.  This is currently in <code>Program.cs</code> in <code>CreateHostBuilder</code> :</p>
  
  <pre><code>.ConfigureLogging(logging =&gt;
  {
      logging.AddConsole();
  })
  </code></pre>
  
  <p>I assume I should replace this? But, with what?  I am not sure where to go from here. The <a href="https://github.com/serilog/serilog-sinks-azuretablestorage" rel="nofollow noreferrer">serilog-sinks-azuretablestorage</a> page on GutHub isn't much help. And I've been unable to find anything via Google that explains how to finish the implementation. </p>