You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/identityserver/diagnostics/logging.md
+86Lines changed: 86 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,92 @@ In production, logging might produce too much data. It is recommended you either
51
51
instrumentation.
52
52
:::
53
53
54
+
### Setup for Microsoft.Extensions.Logging
55
+
56
+
.NET provides a logging abstraction interface found in the
57
+
[Microsoft.Extensions.Logging](https://www.nuget.org/packages/Microsoft.Extensions.Logging) package and is the default logging provider for ASP.NET Core.
58
+
59
+
If you prefer to use Microsoft's logging option,
60
+
you can remove references to Serilog and fall back to the default logging implementation.
61
+
Duende IdentityServer already uses the `ILogger` interface,
62
+
and will use any implementation registered with the services collection.
63
+
64
+
Below you will find a modified version of the in-memory Duende IdentityServer sample.
65
+
You can use it as a guide to adapt your own instance of Duende IdentityServer to use Microsoft's logging implementation..
You will also need to modify the `appSettings.json` file to include the `Logging` section:
123
+
124
+
```json
125
+
{
126
+
"Logging": {
127
+
"LogLevel": {
128
+
"Default": "Information",
129
+
"Microsoft": "Warning",
130
+
"Microsoft.Hosting.Lifetime": "Information",
131
+
"Duende.IdentityServer": "Information"
132
+
}
133
+
},
134
+
"AllowedHosts": "*"
135
+
}
136
+
```
137
+
138
+
Learn more about configuring logging in .NET applications by reading the [Microsoft documentation on logging fundamentals](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-9.0#configure-logging). As you'll see in the Microsoft documentation, configuring logging can be very involved and target different log levels, which can be useful for troubleshooting.
139
+
54
140
### Setup For Serilog
55
141
56
142
We personally like [Serilog](https://serilog.net) and
0 commit comments