示例#1
0
 internal static IHostBuilder CreateHostBuilder(string[] args) =>
 Host.CreateDefaultBuilder(args)
 .ConfigureWebHostDefaults(webBuilder =>
 {
     webBuilder.UseStartup <Startup>();
 })
 .UseSerilog((context, loggerConfiguration) =>
 {
     SerilogToEsExtensions.SetSerilogConfiguration(
         loggerConfiguration,
         context.Configuration);
 })
 .UseAutofac();
示例#2
0
 public static IHostBuilder CreateHostBuilder(string[] args) =>
 Microsoft.Extensions.Hosting.Host.CreateDefaultBuilder(args)
 .ConfigureWebHostDefaults(webBuilder =>
 {
     webBuilder.UseStartup <Startup>();
 })
 .ConfigureAppConfiguration((context, builder) => {
     // ÅäÖÃnacos
     builder.AddNacosConfiguration(builder.Build().GetSection("NacosConfig"));
 })
 .UseSerilog((context, loggerConfiguration) =>
 {
     SerilogToEsExtensions.SetSerilogConfiguration(
         loggerConfiguration,
         context.Configuration);
 }).UseAutofac();