Manu Mohanan
Manu Mohanan

Reputation: 41

Connect Azure app service Logs to ELK

I need my azure app service's logs and error logs to be visualized using ELK stack. How to connect these logstash.?. How can I ship my app service logs to logstash.?

Upvotes: 1

Views: 1260

Answers (1)

batikh
batikh

Reputation: 36

use NLog (https://nlog-project.org/)

 <?xml version="1.0" encoding="utf-8"?>

  <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xsi:schemaLocation="NLog NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      internalLogFile="internal.nlog"
      throwExceptions="true"
      throwConfigExceptions="true"
      internalLogLevel="Debug">

    <extensions>
        <add assembly="NLog.StructuredLogging.Json" />
    </extensions>

    <targets>
        <target xsi:type="Console" name="console" layout="${structuredlogging.json}" />

        <!--<target name="logstash" xsi:type="BufferingWrapper" flushTimeout="5000">-->
        <target name="logstash" xsi:type="Network" layout="${structuredlogging.json}" address="elasticsearch:5443" />
        <!--</target>-->
    </targets>

    <rules>
        <logger name="*" writeTo="logstash" />
        <logger name="*" minlevel="Trace" writeTo="console" />
    </rules>
</nlog>

Upvotes: 2

Related Questions