markmcdowell / NLog.Targets.ElasticSearch

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

ConnectionStringName is not work in 6.1 version #94

Closed qjw2bqn closed 5 years ago

qjw2bqn commented 5 years ago

The version of 5.1 works fine,but upgrade to netcore 2.2,and NLog.Targets.ElasticSearch to 6.1, even though setting the
"ConnectionStrings": { "ElasticSearchServerAddress": "http://192.168.31.101:9200" }, in the appsetting.json file,it use the default url:localhost:9200 to connect the elk server.

But if use the uri work fine,change the uri to connectionString don't work!

snakefoot commented 5 years ago

Try making use of ${configsetting} to lookup the ElasticSearchServerAddress-value for the Uri-Target-property.

See also https://github.com/NLog/NLog/wiki/ConfigSetting-Layout-Renderer

Believe the plan is to remove ConnectionString-Lookup from this target.

markmcdowell commented 5 years ago

Yes please use configsetting, ConnectionStringName has been removed.