-
Notifications
You must be signed in to change notification settings - Fork 391
Expand file tree
/
Copy pathProgram.cs
More file actions
36 lines (31 loc) · 870 Bytes
/
Program.cs
File metadata and controls
36 lines (31 loc) · 870 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) Duende Software. All rights reserved.
// See LICENSE in the project root for license information.
using MvcSaml;
using Serilog;
using Serilog.Events;
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.MinimumLevel.Override("MvcSaml", LogEventLevel.Debug)
.Enrich.FromLogContext()
.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level}] {SourceContext}{NewLine}{Message:lj}{NewLine}{Exception}{NewLine}")
.CreateLogger();
try
{
var builder = WebApplication
.CreateBuilder(args);
builder
.AddServiceDefaults();
builder
.ConfigureServices()
.ConfigurePipeline()
.Run();
}
catch (Exception ex)
{
Log.Fatal(ex, messageTemplate: "Unhandled exception");
}
finally
{
Log.Information(messageTemplate: "Shut down complete");
Log.CloseAndFlush();
}