using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Logging; using Serilog; namespace Ordering.BackgroundTasks { public class Program { public static void Main(string[] args) { BuildWebHost(args).Run(); } public static IWebHost BuildWebHost(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() .ConfigureLogging((hostingContext, builder) => { builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging")); builder.AddDebug(); builder.AddConsole(); }) .UseSerilog((builderContext, config) => { config .MinimumLevel.Information() .Enrich.FromLogContext() .WriteTo.Console(); }) .Build(); } }