3

I'm a bit confused about my options for Function App logging on Azure. Is Application Insights the only mechanism available to observe the output logged through the function application's context? In other words, can logs be tailed or log files be temporarily observed anywhere without draining to an instance of Application Insights?

1 Answer 1

1

You can also configure Azure Functions with NLog:

https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-cloud-logging-with-Azure-function-or-AWS-lambda

Here you can find a sample that shows an Azure Function with NLog and GrayLog

Logging API Requests and Responses to GrayLog over Azure API Management using Azure Functions

nlog.config:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      throwExceptions="false"
      internalLogLevel="Off">
  <extensions>
    <add assembly="NLog.Web.AspNetCore"/>
    <add assembly="NLog.Web.AspNetCore.Targets.Gelf"/>
  </extensions>
  <targets>
    <target xsi:type="Gelf" name="graylog" endpoint="udp://localhost:12201" facility="APM.RequestLogging.Function" SendLastFormatParameter="true" />
  </targets>
  <rules>
    <logger level="Info" writeTo="graylog" />
  </rules>
</nlog>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.