Skip to content

Commit

Permalink
Be explicit about engineId in every log (#490)
Browse files Browse the repository at this point in the history
Only log 500 codes
  • Loading branch information
johnml1135 authored Sep 12, 2024
1 parent df6673e commit cf71555
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class ErrorResultFilter(ILoggerFactory loggerFactory) : IAlwaysRunResultF

public void OnResultExecuted(ResultExecutedContext context)
{
if (context.HttpContext.Response.StatusCode >= 400)
if (context.HttpContext.Response.StatusCode >= 500)
{
_logger.LogInformation(
"Client {client} made request:\n {request}.\n Serval responded with code {statusCode}. Trace: {activityId}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,12 @@ CancellationToken cancellationToken
);
if (usfm == "")
return NoContent();
_logger.LogInformation("Returning USFM for {TextId} in {CorpusId} of {EngineId}", textId, corpusId, id);
_logger.LogInformation(
"Returning USFM for {TextId} in engine {EngineId} for corpus {corpusId}",
textId,
id,
corpusId
);
return Content(usfm, "text/plain");
}

Expand Down

0 comments on commit cf71555

Please sign in to comment.