Skip to content

Commit

Permalink
add logger debug
Browse files Browse the repository at this point in the history
  • Loading branch information
guillaume-chervet committed Feb 5, 2025
1 parent f61f852 commit 951a25b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/SlimFaas/SlimProxyMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Net;
using System.Text.Json;
using System.Text.Json.Serialization;
using MemoryPack;
using SlimData;
Expand Down Expand Up @@ -109,8 +110,12 @@ await contextResponse.WriteAsJsonAsync(functionStatuses,
contextResponse.StatusCode = (int)HttpStatusCode.BadRequest;
return;
}


logger.LogInformation("Create job {JobName} with {CreateJob}", functionName, createJob);
if(logger.IsEnabled(LogLevel.Debug))
{
logger.LogDebug("Create job details {CreateJob} ", JsonSerializer.Serialize(createJob,
CreateJobSerializerContext.Default.CreateJob));
}

await jobService.CreateJobAsync(functionName, createJob);
contextResponse.StatusCode = 204;
Expand Down

0 comments on commit 951a25b

Please sign in to comment.