2018-01-18 17:29:23 +01:00
|
|
|
|
using Microsoft.AspNetCore;
|
|
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
|
|
|
using Microsoft.Extensions.Logging;
|
2018-12-13 12:13:59 +01:00
|
|
|
|
using Serilog;
|
2018-01-18 17:29:23 +01:00
|
|
|
|
|
|
|
|
|
namespace Ordering.BackgroundTasks
|
|
|
|
|
{
|
|
|
|
|
public class Program
|
|
|
|
|
{
|
|
|
|
|
public static void Main(string[] args)
|
|
|
|
|
{
|
|
|
|
|
BuildWebHost(args).Run();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IWebHost BuildWebHost(string[] args) =>
|
|
|
|
|
WebHost.CreateDefaultBuilder(args)
|
2018-11-30 17:43:22 +01:00
|
|
|
|
.UseStartup<Startup>()
|
2018-01-18 17:29:23 +01:00
|
|
|
|
.ConfigureLogging((hostingContext, builder) =>
|
|
|
|
|
{
|
|
|
|
|
builder.AddConfiguration(hostingContext.Configuration.GetSection("Logging"));
|
|
|
|
|
builder.AddDebug();
|
|
|
|
|
builder.AddConsole();
|
2018-12-13 12:13:59 +01:00
|
|
|
|
})
|
|
|
|
|
.UseSerilog((builderContext, config) =>
|
|
|
|
|
{
|
|
|
|
|
config
|
|
|
|
|
.MinimumLevel.Information()
|
|
|
|
|
.Enrich.FromLogContext()
|
|
|
|
|
.WriteTo.Console();
|
|
|
|
|
})
|
|
|
|
|
.Build();
|
2018-01-18 17:29:23 +01:00
|
|
|
|
}
|
|
|
|
|
}
|