这是我拥有的代码的胆量。我想写入日志以进行故障排除。它不喜欢其他方法。我看到了一些例子,他们讨论了如何实现这一点,但我找不到真正的代码来尝试。
我正在门户中编写 Azure 函数。
非常感谢任何帮助。
public static async Task<IActionResult> Run(HttpRequest req, ILogger log)
{
log.LogInformation("C# HTTP trigger function processed a request.");
bool isGood = Verify(myKey, myInput;
return code != null
? (ActionResult)new OkObjectResult($"Request Successful")
: new BadRequestObjectResult("Bad Request");
} // End Main
public static bool Verify(String key, String input)
{
log.LogInformation("Write something here");
return;
}
private static string CreateToken(string message, string secret)
{
log.LogInformation("Write something here");
return;
}