Skip to content

Commit

Permalink
Hotfix string interpolation on logging for v4 establishments endpoints (
Browse files Browse the repository at this point in the history
  • Loading branch information
cshnimble authored Jul 22, 2024
1 parent a366f96 commit 2b9f713
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions TramsDataApi/Controllers/V4/EstablishmentsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Azure.Core;
using Dfe.Academies.Application.Establishment;
using Dfe.Academies.Contracts.V4.Establishments;
using Microsoft.AspNetCore.Mvc;
Expand Down Expand Up @@ -98,14 +99,14 @@ public async Task<ActionResult<EstablishmentDto>> GetEstablishmentByUrn(string u
public async Task<ActionResult<List<EstablishmentDto>>> SearchEstablishments(string name, string ukPrn, string urn, CancellationToken cancellationToken)
{
_logger.LogInformation(
"Searching for establishments by name \"{name}\", UKPRN \"{prn}\", urn \"{number}\"}",
"Searching for establishments by name \"{name}\", UKPRN \"{ukPrn}\", urn \"{number}\"",
name, ukPrn, urn);

var (establishments, recordCount) = await _establishmentQueries
.Search(name, ukPrn, urn, cancellationToken).ConfigureAwait(false);

_logger.LogInformation(
"Found {count} establishments for name \"{name}\", UKPRN \"{prn}\", urn \"{number}\"",
"Found {count} establishments for name \"{name}\", UKPRN \"{ukPrn}\", urn \"{number}\"",
recordCount, name, ukPrn, urn);

_logger.LogDebug(JsonSerializer.Serialize(establishments));
Expand All @@ -127,8 +128,8 @@ public async Task<ActionResult<List<EstablishmentDto>>> SearchEstablishments(str
[SwaggerResponse(404, "No establishments found for specified regions.")]
public async Task<ActionResult<IEnumerable<int>>> GetURNsByRegion([FromQuery] string[] regions, CancellationToken cancellationToken)
{
_logger.LogInformation(
"Searching for establishment URNs by regions\"{regions}\"}",
_logger.LogInformation(
"Searching for establishment URNs by regions\"{regions}\"",
regions);

var establishmentURNs = await _establishmentQueries
Expand Down

0 comments on commit 2b9f713

Please sign in to comment.