Skip to content

Commit 81c29fb

Browse files
committed
Update Log level for ProviderProfile
1 parent 7b1411f commit 81c29fb

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

OFM.Infrastructure.WebAPI/Handlers/ProviderProfileHandlers.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public static async Task<Results<BadRequest<string>, NotFound<string>, Unauthori
114114
</entity>
115115
</fetch>
116116
""";
117-
117+
118118
var requestUri = $"""
119119
contacts?$select=ofm_first_name,ofm_last_name,ccof_userid,ccof_username,contactid,emailaddress1,_ofm_portal_role_id_value,telephone1&$expand=ofm_facility_business_bceid($select=_ofm_bceid_value,_ofm_facility_value,ofm_name,ofm_is_expense_authority,ofm_portal_access,ofm_bceid_facilityid,statecode,statuscode;$expand=ofm_facility($select=accountid,accountnumber,ccof_accounttype,ofm_program,statecode,statuscode,name,ofm_ccof_requirement,ofm_program_start_date,ofm_unionized;$filter=(ofm_program eq 1 or ofm_program eq 3 or ofm_program eq 4) and (statuscode eq 1));$filter=(statuscode eq 1)),parentcustomerid_account($select=accountid,accountnumber,ccof_accounttype,name,statecode,statuscode,ofm_program;$filter=(statuscode eq 1)),ofm_portal_role_id($select=ofm_portal_role_number)&$filter=(ccof_userid eq '{userId}' or ccof_username eq '{userName}') and (statuscode eq 1) and (ofm_portal_role_id/ofm_portal_roleid ne null)
120120
""";
@@ -156,13 +156,13 @@ public static async Task<Results<BadRequest<string>, NotFound<string>, Unauthori
156156
{
157157
if (currentValue?.AsArray().Count == 0)
158158
{
159-
logger.LogDebug(CustomLogEvent.ProviderProfile, "User not found.");
159+
logger.LogWarning(CustomLogEvent.ProviderProfile, "User not found.");
160160

161161
return TypedResults.NotFound($"User not found.");
162162
}
163163
if (currentValue?.AsArray().Count > 1)
164164
{
165-
logger.LogDebug(CustomLogEvent.ProviderProfile, "Multiple profiles found.");
165+
logger.LogWarning(CustomLogEvent.ProviderProfile, "Multiple profiles found.");
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.LogDebug(CustomLogEvent.ProviderProfile, "Organization or facility permissions not found.");
178+
logger.LogWarning(CustomLogEvent.ProviderProfile, "Organization or facility permissions not found.");
179179
return TypedResults.Unauthorized();
180180
}
181181

@@ -194,12 +194,12 @@ public static async Task<Results<BadRequest<string>, NotFound<string>, Unauthori
194194
{
195195
logger.LogError("Failed to update the userId for {userName}. Response: {response}.", userName, userResponse);
196196
}
197-
197+
198198
portalProfile.ccof_userid = userId; // Add the UseId to the return payload to help with validation on the portal
199199
}
200200

201201
//logger.LogDebug(CustomLogEvent.ProviderProfile, "Return provider profile {portalProfile}", portalProfile);
202-
logger.LogInformation(CustomLogEvent.ProviderProfile, "Querying provider profile finished in {totalElapsedTime} miliseconds", timeProvider.GetElapsedTime(startTime, endTime).TotalMilliseconds);
202+
logger.LogInformation(CustomLogEvent.ProviderProfile, "Querying provider profile finished in {totalElapsedTime} miliseconds. UserName: {userName} ", timeProvider.GetElapsedTime(startTime, endTime).TotalMilliseconds, userName);
203203

204204
return TypedResults.Ok(portalProfile);
205205
}

tools/config/update-configmap.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ D365_LOG_LEVEL=$(cat << JSON
2626
{
2727
"LogLevel": {
2828
"Default": "Error",
29-
"OFM.Portal.ProviderProfile": "Error",
29+
"OFM.Portal.ProviderProfile": "Warning",
3030
"OFM.D365.Process": "Error",
3131
"OFM.D365.Batch": "Error",
3232
"Microsoft.AspNetCore": "Error"
@@ -56,7 +56,7 @@ D365_LOG_LEVEL=$(cat << JSON
5656
{
5757
"LogLevel": {
5858
"Default": "Warning",
59-
"OFM.Portal.ProviderProfile": "Error",
59+
"OFM.Portal.ProviderProfile": "Warning",
6060
"OFM.D365.Process": "Information",
6161
"OFM.D365.Batch": "Warning",
6262
"Microsoft.AspNetCore": "Warning"
@@ -86,7 +86,7 @@ D365_LOG_LEVEL=$(cat << JSON
8686
{
8787
"LogLevel": {
8888
"Default": "Error",
89-
"OFM.Portal.ProviderProfile": "Error",
89+
"OFM.Portal.ProviderProfile": "Warning",
9090
"OFM.D365.Process": "Information",
9191
"OFM.D365.Batch": "Error",
9292
"Microsoft.AspNetCore": "Error"

0 commit comments

Comments
 (0)