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: support/entra/entra-id/app-integration/serilog-protected-web-api-authentication-authorization-errors.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Use Serilog to troubleshoot protected Web API authentication or authorization errors
3
3
description: Provides a sample web API application to troubleshoot Microsoft Entra protected Web API authentication or authorization errors using Serilog logs.
4
-
ms.date: 04/28/2025
4
+
ms.date: 05/07/2025
5
5
ms.service: entra-id
6
6
ms.custom: sap:Developing or Registering apps with Microsoft identity platform
7
7
ms.reviewer: bachoang, v-weizhu
@@ -52,6 +52,21 @@ Change the following information in the `AzureAd` section in the **appsettings.j
52
52
53
53
Change the `ValidAudiences` and `ValidIssuers` properties of the [TokenValidationParameters](/dotnet/api/microsoft.identitymodel.tokens.tokenvalidationparameters) class in the **Program.cs** file.
54
54
55
+
### Step 4: Configure Serilog
56
+
57
+
Configure Serilog in the `Serilog` section in the **appsettings.json** file as follows:
58
+
59
+
```json
60
+
"Serilog": {
61
+
"MinimumLevel": {
62
+
"Default": "Information",
63
+
"Override": {
64
+
"Microsoft": "Debug",
65
+
"Microsoft.Hosting.Lifetime": "Information"
66
+
}
67
+
},
68
+
```
69
+
55
70
## Set up logging for JwtBearer events
56
71
57
72
Here's the sample Program.cs file that shows how to set up logging for the preceding events:
0 commit comments