Closed thomas1983 closed 5 years ago
Hey, which platform where you targeting with this?
Hi. I'm also having exactly the same issue and error. My XML config looks like this... NLog installed on Xamarin and the config file is loaded correctly. code:
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true"
throwExceptions="true"
throwConfigExceptions="true">
<extensions>
<add assembly="NLog.Targets.ElasticSearch" />
</extensions>
<targets async="true">
<target name="elastic" xsi:type="BufferingWrapper" flushTimeout="5000">
<target xsi:type="ElasticSearch"
layout="${message}"
index="logstash-${date:format=yyyy.MM.dd}"
includeAllProperties="true"
uri="http://xxx.xxx.xxx.xxx:9200"
ThrowExceptions = "true">
<field name="time" layout="${longdate}" />
<field name="application" layout="My.Mobile.App" />
<field name="hostname" layout="${machinename}" />
<field name="logger" layout="${logger}" />
<field name="level" layout="${level:upperCase=true}"/>
<field name="message" layout="${message}" />
<field name="exception" layout="${exception:format=ToString,Data}" />
</target>
</target>
<target name="files" xsi:type="File" fileName="${basedir}/logs/${longdate}-${level:upperCase=true}.log">
<layout xsi:type="JsonLayout" includeAllProperties="true">
<attribute name="time" layout="${longdate}" />
<attribute name="application" layout="My.App" />
<attribute name="hostname" layout="${machinename}" />
<attribute name="logger" layout="${logger}" />
<attribute name="level" layout="${level:upperCase=true}"/>
<attribute name="message" layout="${message}" />
<attribute name="exception" layout="${exception:format=ToString,Data}" />
</layout>
</target>
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="elastic" />
</rules>
</nlog>```
Hi,
I got following exception when setting configuration:
code:
edit: Nlog.Targets.ElasticSearch: 4.0.0-beta21 Nlog: 5.0.0-beta11