Exemple #1
0
        public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
        WebHost.CreateDefaultBuilder(args)
        .UseConfiguration(new ConfigurationBuilder().AddJsonFile("HostingSettings.json", optional: true).Build())
        .ConfigureAppConfiguration(configBuilder =>
        {
            configBuilder.AddJsonFile("config/AppSettings.json", optional: false);
        })
        .ConfigureLogging((hostingContext, loggingBuilder) =>
        {
            var loggingSettings = new LoggingSettings();
            var configuration   = hostingContext.Configuration;
            configuration.Bind("logging", loggingSettings);

            var loggingConfiguration = new LoggingConfiguration();
            loggingConfiguration.LoadSettings(loggingSettings);
            loggingConfiguration.AddLogging(loggingBuilder);
        })
        .UseStartup <Startup>();