title: How to access AppSettings in Startup class constructor in .NET Core
body: <p>I'm trying to add SeriLog settings like min log level and rolling file path from a config file.  The standard is to hard code them like this:</p>
  
  <pre><code>public Startup(IHostingEnvironment env)
  {
      var builder = new ConfigurationBuilder()
          .SetBasePath(env.ContentRootPath)
          .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
          .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
          .AddEnvironmentVariables();
      Configuration = builder.Build();
  
      Log.Logger = new LoggerConfiguration()
          .MinimumLevel.Debug()
          .WriteTo.RollingFile("C:/LogFiles/log-{Date}.txt")
          .CreateLogger();
  }
  </code></pre>
  
  <p>Basically, I need to be able to access values from appsettings.json in the Startup constructor.  Something like this:</p>
  
  <pre><code>Log.Logger = new LoggerConfiguration()
      .MinimumLevel.Is((LogEventLevel)Enum.Parse(typeof(LogEventLevel),
          Configuration.GetValue&lt;string&gt;("AppSettings.MinimumLoggingLevel")))
      .WriteTo.RollingFile(Configuration.GetValue&lt;string&gt;("AppSettings.RollingFilePath"))
  </code></pre>
  
  <p>I found the <code>Configuration.GetValue</code> syntax in another SO post, but it always returns <code>null</code>.</p>