Answers: <p>You can also configure Azure Functions with NLog:</p>
  <p><a href="https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-cloud-logging-with-Azure-function-or-AWS-lambda" rel="nofollow noreferrer">https://github.com/NLog/NLog.Extensions.Logging/wiki/NLog-cloud-logging-with-Azure-function-or-AWS-lambda</a></p>
  <p>Here you can find a sample that shows an Azure Function with NLog and GrayLog</p>
  <p><a href="https://www.gokhan-gokalp.com/en/logging-api-requests-and-responses-to-graylog-over-azure-api-management-using-azure-functions/" rel="nofollow noreferrer">Logging API Requests and Responses to GrayLog over Azure API Management using Azure Functions</a></p>
  <p>nlog.config:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
  &lt;nlog xmlns=&quot;http://www.nlog-project.org/schemas/NLog.xsd&quot;
        xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
        autoReload=&quot;true&quot;
        throwExceptions=&quot;false&quot;
        internalLogLevel=&quot;Off&quot;&gt;
    &lt;extensions&gt;
      &lt;add assembly=&quot;NLog.Web.AspNetCore&quot;/&gt;
      &lt;add assembly=&quot;NLog.Web.AspNetCore.Targets.Gelf&quot;/&gt;
    &lt;/extensions&gt;
    &lt;targets&gt;
      &lt;target xsi:type=&quot;Gelf&quot; name=&quot;graylog&quot; endpoint=&quot;udp://localhost:12201&quot; facility=&quot;APM.RequestLogging.Function&quot; SendLastFormatParameter=&quot;true&quot; /&gt;
    &lt;/targets&gt;
    &lt;rules&gt;
      &lt;logger level=&quot;Info&quot; writeTo=&quot;graylog&quot; /&gt;
    &lt;/rules&gt;
  &lt;/nlog&gt;
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2022-06-14T05:37:35.743Z
Answers: 2022-06-14T05:37:35.743Z
Answers: Markus Meyer
Body: <p>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?</p>
  
Tags: <azure><logging>
Title: Azure Function App logs without Application Insights instance?
UserDisplayName: Chris Betti
ThreadText: # Azure Function App logs without Application Insights instance?
  
  (Asked by: username_0 on 2022-06-06)
  
  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?
  
  **Tags:** azure, logging
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-06-14. Score: 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](https://www.gokhan-gokalp.com/en/logging-api-requests-and-responses-to-graylog-over-azure-api-management-using-azure-functions/)
  
  nlog.config:
  
  ```xml
  <?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>
  
  ```
  
  
  ---
  
  