question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uri property cannot be reconfigured programmatically

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rmindelcommented, Jun 27, 2019

Should we consider Username and Password flelds as well?

Might be useful for all the properties that are used in creating the _client (Uri, ElasticSearchSerializer, RequireAuth, Username, Password, DisableAutomaticProxyDetection, DisablePing, EnableHttpCompression)

0reactions
snakefootcommented, Aug 18, 2019

@markmcdowell Resolved by #101 ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found