Uri property cannot be reconfigured programmatically
See original GitHub issueI need to configure the target’s uri and index in the code.
var target = LogManager.Configuration.FindTargetByName(targetName);
var elasticTarget = target as NLog.Targets.ElasticSearch.ElasticSearchTarget;
if (elasticTarget != null)
{
elasticTarget.Uri = uri;
elasticTarget.Index = index;
}
This code works on the index property but the uri property doesn’t affect the target. In ElasticSearchTarget.cs the _uri member is used only in InitializeTarget, changing the uri property doesn’t force it to re-calculate node and the connection pool so it cant be changed using code.
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
apache - How to use a dynamic URI in From()
You can read it from property file as follows, <bean id="bridgePropertyPlaceholder" class="org.apache.camel.spring.spi.
Read more >If folders don't exist in URI path, file_save_data() fails
When I run this I get the following error: The specified file temporary://fileJ4LL4o could not be copied, because the destination directory is ...
Read more >Spring Data MongoDB – Configure Connection
In this tutorial, we'll learn different ways to configure a connection to our database. We'll use Spring Boot and Spring Data MongoDB.
Read more >OAuth 2.0 Resource Server JWT
An authorization server's JWK Set Uri can be configured as a configuration property or it can be supplied in the DSL: JWK Set...
Read more >Context Configuration with Test Property Sources
MyTest , the corresponding default properties file is classpath:com/example/MyTest.properties . If the default cannot be detected, an ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Might be useful for all the properties that are used in creating the _client (Uri, ElasticSearchSerializer, RequireAuth, Username, Password, DisableAutomaticProxyDetection, DisablePing, EnableHttpCompression)
@markmcdowell Resolved by #101 ?