Note Onion - 4 - API - appsettings.json

Here is the source code for appsettings.json This is placed in the root directory of the Note.Api project

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
37
38
39
40
41
42
43
44
45
46
47
{
"NotesDatabaseSettings": {
"ConnectionString": "Server=.; Database=Notes; integrated security=true;Trust Server Certificate=true;",
"IsSSL": true
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"NoteConnectionString": "Server=.; Database=Notes; integrated security=true;Trust Server Certificate=true;"
},
"Serilog": {
// This is used to initialize Serilog logger.
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"Microsoft.AspNetCore.Hosting.Diagnostics": "Error",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"WriteTo": [
// this enables logging to a file
{
"Name": "File",
"Args": {
"path": "e:\\t\\NoteLog.txt",
"rollingInterval": "Day",
"formatter": "Serilog.Formatting.Compact.CompactJsonFormatter, Serilog.Formatting.Compact"
}
}
// note: WriteTo is an array. you can send output to multiple destinations
],
"Enrich": [
//
// this enriches the log with additional information
//
"WithMachineName",
"WithProcessId",
"WithThreadId"
]
}
}

Here is the source code for appsettings.Development.json This is placed in the root directory of the Note.Api project. It is loaded if the API is running in a development environment.

1
2
3
4
5
6
7
8
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}