diff --git a/src/BIAnalyticsDataService/GetParticipantScreeningProfileData/GetParticipantScreeningProfileData.cs b/src/BIAnalyticsDataService/GetParticipantScreeningProfileData/GetParticipantScreeningProfileData.cs index 87f2f084..b5827962 100644 --- a/src/BIAnalyticsDataService/GetParticipantScreeningProfileData/GetParticipantScreeningProfileData.cs +++ b/src/BIAnalyticsDataService/GetParticipantScreeningProfileData/GetParticipantScreeningProfileData.cs @@ -50,7 +50,7 @@ public async Task Run([HttpTrigger(AuthorizationLevel.Anonymou } catch (Exception ex) { - _logger.LogError(ex, "GetParticipantScreeningProfileData: Failed to get participant profiles from the database.\nException: " + ex.Message); + _logger.LogError(ex, "GetParticipantScreeningProfileData: Failed to get participant profiles from the database.\nException: {Message}", ex.Message); return req.CreateResponse(HttpStatusCode.InternalServerError); } } diff --git a/src/BIAnalyticsService/GetParticipantScreeningProfile/GetParticipantScreeningProfile.cs b/src/BIAnalyticsService/GetParticipantScreeningProfile/GetParticipantScreeningProfile.cs index d6ca338f..b9840696 100644 --- a/src/BIAnalyticsService/GetParticipantScreeningProfile/GetParticipantScreeningProfile.cs +++ b/src/BIAnalyticsService/GetParticipantScreeningProfile/GetParticipantScreeningProfile.cs @@ -61,7 +61,7 @@ public async Task Run([HttpTrigger(AuthorizationLevel.Anonymou if (!response.IsSuccessStatusCode) { - _logger.LogError($"Failed to retrieve profiles. Status Code: {response.StatusCode}"); + _logger.LogError("Failed to retrieve profiles. Status Code: {StatusCode}", response.StatusCode); var errorResponse = req.CreateResponse(response.StatusCode); return errorResponse; } @@ -78,7 +78,7 @@ public async Task Run([HttpTrigger(AuthorizationLevel.Anonymou } catch (Exception ex) { - _logger.LogError(ex, "Exception when calling the GetParticipantScreeningProfileData function. \nUrl:{url}\nException: " + ex.Message, url); + _logger.LogError(ex, "Exception when calling the GetParticipantScreeningProfileData function. \nUrl:{url}\nException: {Message}", url, ex.Message); return req.CreateResponse(HttpStatusCode.InternalServerError); } } diff --git a/src/ParticipantManagementService/GetParticipant/GetParticipant.cs b/src/ParticipantManagementService/GetParticipant/GetParticipant.cs index b6d8a887..4fe420a8 100644 --- a/src/ParticipantManagementService/GetParticipant/GetParticipant.cs +++ b/src/ParticipantManagementService/GetParticipant/GetParticipant.cs @@ -31,7 +31,7 @@ public async Task Run([HttpTrigger(AuthorizationLevel.Anonymou if (participant == null) { - _logger.LogError($"Participant with NHS Number {nhsNumber} not found."); + _logger.LogError("Participant with NHS Number {nhsNumber} not found.", nhsNumber); return req.CreateResponse(HttpStatusCode.NotFound); }