title: Serilog File sink not logging to file
body: <p>i am trying to get Serilog file sink working on my ASP.Net core 2.2 application based on the the <a href="https://github.com/serilog/serilog-sinks-file" rel="nofollow noreferrer">documentation</a>. I am not able to see logs in my application. 
  What am I missing?</p>
  
  <p><strong>Program.cs:</strong></p>
  
  <pre><code>using Microsoft.AspNetCore;
  using Microsoft.AspNetCore.Hosting;
  using Microsoft.Extensions.Configuration;
  using Serilog;
  using System;
  
  namespace Scrubber
  {
    public class Program
    {
      private static string _environmentName;
  
      public static void Main(string[] args)
      {
        try
        {
          var iWebHost = CreateWebHostBuilder(args).Build();
          var configuration = new ConfigurationBuilder()
            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
            .AddJsonFile($"appsettings.{_environmentName}.json", optional: true, reloadOnChange: true)
          .Build();
  
          var logger = new LoggerConfiguration()
            .ReadFrom.Configuration(configuration.GetSection("Serilog"))
            .CreateLogger();
          Log.Logger = logger;
          Log.Information("Application starting");
          iWebHost.Run();
        }
        catch(Exception exception)
        {
          Log.Error(exception.ToString());
        }
        finally
        {
          Log.CloseAndFlush();
        }
      }
  
      public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
            WebHost.CreateDefaultBuilder(args)
            .ConfigureLogging((hostingContext, config) =&gt;
            {
              //config.ClearProviders();
              _environmentName = hostingContext.HostingEnvironment.EnvironmentName;
            })
            .UseStartup&lt;Startup&gt;();
      }
  }
  </code></pre>
  
  <p><strong>Appsettings.development.json:</strong></p>
  
  <pre><code>{
    "Logging": {
      "LogLevel": {
        "Default": "Debug",
        "System": "Information",
        "Microsoft": "Information"
      }
    },
    "Serilog": {
      "WriteTo": [
        {
          "Name": "File",
          "Args": {
            "path": "log.txt",
            "rollingInterval": "Day"
          }
        }
      ]
    } 
  }
  </code></pre>