-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
26 lines (21 loc) · 822 Bytes
/
Copy pathProgram.cs
File metadata and controls
26 lines (21 loc) · 822 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
using multi_login;
using Serilog.Events;
using Serilog;
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Information()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.Hosting.Lifetime", LogEventLevel.Information)
.Enrich.FromLogContext()
.WriteTo.Console()
.WriteTo.MongoDB(
Environment.GetEnvironmentVariable("MONGODB_URI_LOG"),
collectionName: "logs",
restrictedToMinimumLevel: LogEventLevel.Information,
period: TimeSpan.FromSeconds(1))
.CreateLogger();
var builder = WebApplication.CreateBuilder(args);
var app = builder
.ConfigureServices()
.ConfigurePipeline();
// run the App.
app.Run();