log4net.ElasticSearch
log4net.ElasticSearch copied to clipboard
AWS Elastic Search Service connection issue with log4Net
I am using Amazon Elasticsearch Service for creating domains using a fine-grained access domain( username and password)
I have configured app.config like this
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<log4net>
<appender name="ElasticSearchAppender" type="log4net.ElasticSearch.ElasticSearchAppender, log4net.ElasticSearch">
<!-- for .NET 40 <appender name="ElasticSearchAppender" type="log4net.ElasticSearch.ElasticSearchAppender, log4net.ElasticSearch.Net40">-->
<connectionString value="Scheme=https;User=xxxx;Pwd=xxxxxx;Server=search-xxxxx-xxxxxxx.region.es.amazonaws.com;Index=log;Port=443;rolling=true"/>
<lossy value="false" />
<evaluator type="log4net.Core.LevelEvaluator">
<threshold value="ERROR" />
</evaluator>
<bufferSize value="100" />
</appender>
<root>
<level value="ALL"/>
<appender-ref ref="ElasticSearchAppender" />
</root>
</log4net>
</configuration>
Calling Method :
private static readonly ILog _log = LogManager.GetLogger(typeof(Program)); _log.Error("errorr", new ApplicationException("The new application exploded")); I tried diagnosing the log4net Logs in to text file, but there is no error in that
Can anyone suggest If there is any possible way to work with Elasticsearch as a service?
Thanks in Advance
As a starting point:
-
Create a new account in ElasticSearch, but make sure that the username and password are in plaintext. No special characters in the password. For example, username: name & password: pswd
-
It might be a permission problem, therefore, give the user a high role (e.g superuser).