markmcdowell / NLog.Targets.ElasticSearch

NLog target for Elasticsearch
MIT License
176 stars 89 forks source link

Losing logs while elasticsearch server is down. #90

Closed Janjko closed 5 years ago

Janjko commented 5 years ago

I suspect my issue is the same #87, but I'm not sure. I stopped the elasticsearch server, created some logs in the application, and then started the server again. New logs arrived ok, but the ones created while the server was down disappeared. They were still written to disk.

Is this supposed to work, or should I move to filebeat if I want this?

My config looks like this:


<target name="elastic" xsi:type="BufferingWrapper" flushTimeout="5000">
  <target xsi:type="ElasticSearch" uri="http://elasticserver:9200" index="myApp-staging-${date:format=yyyy.MM.dd}"/>
</target>
markmcdowell commented 5 years ago

It sounds like you need the retrying target https://github.com/NLog/NLog/wiki/RetryingWrapper-target, if the elasticsearch target fails to post it doesn't automatically try again.

Janjko commented 5 years ago

Guess that's it. Thanks for great software!