Skip to content

Commit 9402864

Browse files
committed
Update ProviderProfile - Log additional userInfo
1 parent 81c29fb commit 9402864

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

OFM.Infrastructure.WebAPI/Handlers/ProviderProfileHandlers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,13 @@ public static async Task<Results<BadRequest<string>, NotFound<string>, Unauthori
156156
{
157157
if (currentValue?.AsArray().Count == 0)
158158
{
159-
logger.LogWarning(CustomLogEvent.ProviderProfile, "User not found.");
159+
logger.LogWarning(CustomLogEvent.ProviderProfile, "User not found. [userName: {userName} | userId: {userId}]", userName, string.IsNullOrEmpty(userId) ? "NA" : userId);
160160

161161
return TypedResults.NotFound($"User not found.");
162162
}
163163
if (currentValue?.AsArray().Count > 1)
164164
{
165-
logger.LogWarning(CustomLogEvent.ProviderProfile, "Multiple profiles found.");
165+
logger.LogWarning(CustomLogEvent.ProviderProfile, "Multiple profiles found. [userName: {userName} | userId: {userId}]", userName, string.IsNullOrEmpty(userId) ? "NA" : userId);
166166

167167
return TypedResults.Unauthorized();
168168
}
@@ -175,7 +175,7 @@ public static async Task<Results<BadRequest<string>, NotFound<string>, Unauthori
175175
serializedProfile!.First().ofm_facility_business_bceid is null ||
176176
serializedProfile!.First().ofm_facility_business_bceid!.Length == 0)
177177
{
178-
logger.LogWarning(CustomLogEvent.ProviderProfile, "Organization or facility permissions not found.");
178+
logger.LogWarning(CustomLogEvent.ProviderProfile, "Organization or facility permissions not found.[userName: {userName} | userId: {userId}]", userName, string.IsNullOrEmpty(userId) ? "NA" : userId);
179179
return TypedResults.Unauthorized();
180180
}
181181

0 commit comments

Comments
 (0)