dev
Line | |
---|
1 | using Microsoft.AspNetCore.Hosting;
|
---|
2 | using Microsoft.Extensions.Hosting;
|
---|
3 | using Serilog;
|
---|
4 | using Serilog.Events;
|
---|
5 | using Serilog.Sinks.SystemConsole.Themes;
|
---|
6 |
|
---|
7 | namespace FinkiChattery.Identity
|
---|
8 | {
|
---|
9 | public class Program
|
---|
10 | {
|
---|
11 | public static void Main(string[] args)
|
---|
12 | {
|
---|
13 | Log.Logger = new LoggerConfiguration()
|
---|
14 | .MinimumLevel.Debug()
|
---|
15 | .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
|
---|
16 | .MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Information)
|
---|
17 | .MinimumLevel.Override("System", LogEventLevel.Warning)
|
---|
18 | .MinimumLevel.Override("Microsoft.AspNetCore.Authentication", LogEventLevel.Information)
|
---|
19 | .Enrich.FromLogContext()
|
---|
20 | .WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}", theme: AnsiConsoleTheme.Code)
|
---|
21 | .CreateLogger();
|
---|
22 |
|
---|
23 | CreateHostBuilder(args).Build().Run();
|
---|
24 | }
|
---|
25 |
|
---|
26 | public static IHostBuilder CreateHostBuilder(string[] args) =>
|
---|
27 | Host.CreateDefaultBuilder(args)
|
---|
28 | .UseSerilog()
|
---|
29 | .ConfigureWebHostDefaults(webBuilder =>
|
---|
30 | {
|
---|
31 | webBuilder.UseStartup<Startup>();
|
---|
32 | });
|
---|
33 | }
|
---|
34 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.