I am using NLog to write logs to file, which is working fine. Now I want to write logs to Elasticsearch, so I added NLog.Targets.ElasticSearch in nugets package and I configured my Nlog.config file. Unfortunately, I can't see any log information while calling http://localhost:9200/_search
In NLog.config, I added extension and targets for Elasticsearch:
<extensions>
<add assembly="NLog.Extended" />
<add assembly="NLog.Targets.ElasticSearch"/>
</extensions>
<targets>
<target xsi:type="ElasticSearch"
name="elastic"
layout="${logger} | ${threadid} | ${message}"
includeAllProperties="true"
uri="http://localhost:9200"/>
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="file" />
<logger name="*" minlevel="Trace" writeTo="elastic" />
</rules>
I expect Trace type NLog should be written in Elasticsearch. Am I missing something in the config file?
By the way, I checked this doc for parameters: https://github.com/ReactiveMarkets/NLog.Targets.ElasticSearch/wiki