PathString endpoint = ctx.Request.Path;
string? ipAddress = ctx.Connection.RemoteIpAddress?.ToString();
string? currentTime = DateTimeOffset.Now.ToString("yyyy-MM-dd HH:mm:ss.fff zzz");
string requestData = await GetRequestBodyAsync(ctx.Request);
// Log to the endpoint-specific file
Log.Logger.ForContext("SourceContext", "API_Endpoints")
.Information("{Time}: IP: {IP}, Endpoint: {Endpoint}, Data: {Data}",
currentTime, ipAddress, endpoint, requestData);
PathString endpoint = ctx.Request.Path;
string? ipAddress = ctx.Connection.RemoteIpAddress?.ToString();
string? currentTime = DateTimeOffset.Now.ToString("yyyy-MM-dd HH:mm:ss.fff zzz");
string requestData = await GetRequestBodyAsync(ctx.Request);
// Log to the endpoint-specific file
Log.Logger.ForContext("SourceContext", "API_Endpoints")
.Information("{Time}: IP: {IP}, Endpoint: {Endpoint}, Data: {Data}",
currentTime, ipAddress, endpoint, requestData);