-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathProgram.cs
34 lines (30 loc) · 914 Bytes
/
Program.cs
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
using Serilog;
namespace JsonLogApp;
internal partial class Program
{
static void Main(string[] args)
{
var defaultSetting = "Information";
var json =
$$"""
{
"Logging": {
"LogLevel": {
"Default": "{{defaultSetting}}",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
"LogDatabase": "Data Source=.\\SQLEXPRESS;Database=Logging;Integrated Security=SSPI;encrypt=optional"
}
}
""";
SeriLogForJson();
Log.Information("From appsettings.json {P1}", json);
Console.WriteLine();
SeriLogSimple();
Log.Information("From appsettings.json {P1}", json);
Console.ReadLine();
}
}