Skip to content

Instantly share code, notes, and snippets.

@selcukusta
Created January 19, 2019 11:48
Show Gist options
  • Select an option

  • Save selcukusta/1d04acfd09b62a8fd13d0f7f6eaf6f69 to your computer and use it in GitHub Desktop.

Select an option

Save selcukusta/1d04acfd09b62a8fd13d0f7f6eaf6f69 to your computer and use it in GitHub Desktop.
<target name="logstash" xsi:type="Network" address="tcp://logstash.url:8080" newLine="true">
<layout xsi:type="JsonLayout" includeAllProperties="false">
<attribute name="@timestamp" layout="${date:universalTime=true:format=yyyy-MM-ddTHH\:mm\:ss.fffZ}" />
<attribute name="ApplicationName" layout="${iis-site-name:upperCase=true}" />
<attribute name="Logger" layout="${logger}" />
<attribute name="MethodName" layout="${callsite}" />
<attribute name="LogLineNumber" layout="${callsite-linenumber}" />
<attribute name="Date" layout="${date:universalTime=true:format=o}" />
<attribute name="Exception" layout="${exception:maxInnerExceptionLevel=3:format=ToString}" />
<attribute name="CallStack" layout="${stacktrace:format=Raw}" />
<attribute name="Message" layout="${message}" />
<attribute name="Level" layout="${level:upperCase=true}" />
<attribute name="MachineName" layout="${machineName:upperCase=true}" />
<attribute name="Url" layout="${aspnet-Request-Url}" />
<attribute name="Domain" layout="${aspnet-request:serverVariable=HTTP_URL}" />
<attribute name="QueryString" layout="${aspnet-request:queryString}" />
<attribute name="Referer" layout="${aspnet-request:header=Referer}" />
<attribute name="Client-IP" layout="${aspnet-request:header=Client-IP}" />
</layout>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment