Пікірлер
@red6871
@red6871 Ай бұрын
Screen and voice was not clear ,if it possible could you please upload language translation video and this video again plz..
@aalcaraztech
@aalcaraztech 6 ай бұрын
I think this información is very usefull for trace logs with custom objects/values (JSON) from any flow. Thanks a lot for share It!
@stradviolinus
@stradviolinus 6 ай бұрын
Do you think this will be fixed? All my Flows are broken as well.
@paulbeck1
@paulbeck1 Жыл бұрын
#r "Newtonsoft.Json" using System.Net; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Primitives; using Newtonsoft.Json; public static async Task<IActionResult> Run(HttpRequest req, ILogger log) { string requestBody = await new StreamReader(req.Body).ReadToEndAsync(); dynamic data = JsonConvert.DeserializeObject(requestBody); int eventId = data?.eventId; string errType = data?.errType; string errMsg = data?.errMsg; string correlationId = data?.correlationId; string workflowId = data?.workflowId; string workflowUrl = data?.workflowUrl; string flowDisplayName = data?.flowDisplayName; var custProps = new Dictionary<string, object>() { { "CorrelationId", correlationId}, { "WorkflowId", workflowId}, { "WorkflowUrl", workflowUrl}, { "WorkflowDisplayName", flowDisplayName} }; using (log.BeginScope(custProps)) { if (errType=="Debug") { log.Log(LogLevel.Debug, eventId, $"{errMsg}"); } else if (errType=="Critical") { log.Log(LogLevel.Critical, eventId, $"{errMsg}"); } else if (errType=="Warning") { log.Log(LogLevel.Warning, eventId, $"{errMsg}"); } else if (errType=="Trace") { log.Log(LogLevel.Trace, eventId, $"{errMsg}"); } else if (errType=="Error") { log.Log(LogLevel.Error, eventId, $"{errMsg}"); } else { log.LogInformation($"Event is {eventId}, type is {errType}, and msg is {errMsg}"); } }; string responseMessage = $"This HTTP triggered function executed successfully. {errType} - {errMsg}"; return new OkObjectResult(responseMessage); }