.net 语义注销进程ElasticSearch配置
我正在尝试使用ETW/进程外日志正确配置ElasticSearch。我已成功安装了最新版本的进程外记录器,并遵循了平板上概述的步骤 我的.net 语义注销进程ElasticSearch配置,.net,elasticsearch,etw,enterprise-library-5,slab,.net,elasticsearch,Etw,Enterprise Library 5,Slab,我正在尝试使用ETW/进程外日志正确配置ElasticSearch。我已成功安装了最新版本的进程外记录器,并遵循了平板上概述的步骤 我的语义阻塞svc.xml如下所示: <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns="http://schemas.microsoft.com/practices/2013/entlib/semanticlogging/et
语义阻塞svc.xml
如下所示:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns="http://schemas.microsoft.com/practices/2013/entlib/semanticlogging/etw"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://schemas.microsoft.com/practices/2013/entlib/semanticlogging/etw SemanticLogging-svc.xsd">
<!-- Optional settings for fine tuning performance and Trace Event Session identification-->
<traceEventService/>
<!-- Sinks reference definitons used by this host to listen ETW events -->
<sinks>
<elasticsearchSink instanceName="slabtest" connectionString="http://localhost:9200" name="out" index="outofprocessslab" type="test">
<sources>
<eventSource name="ServiceBaseEventSource" level="LogAlways"/>
</sources>
</elasticsearchSink>
<!-- The service identity should have security permissions to access the resource according to each event sink -->
<flatFileSink name="svcRuntime" fileName="SemanticLogging-svc.runtime.log" >
<sources>
<!-- The below settings shows a simple configuration sample for the buit-in non-transient fault tracing -->
<!-- Remove this eventSource if you'd like, and add your own configuration according to the documentation -->
<!-- The name attribute is from the EventSource.Name Property -->
<eventSource name="ServiceBaseEventSource" level="LogAlways"/>
</sources>
<!--[Add any built-in or custom formatter here if the sink supports text formatters]-->
<eventTextFormatter header="----------"/>
</flatFileSink>
<!--[Add any built-in or custom sink definition here]-->
</sinks>
</configuration>
我还应该注意,我已经下载了FullScale180.semanticubling.Elasticsearch
nuget包,并将其放置在与可执行文件相同的目录中。我看到一篇含糊不清的博文,说SLAB的ElasticSearch组件现在是一个社区项目,这为我指明了方向。但是如何配置它以使用进程外服务呢
谢谢。如果有人感兴趣。。。。进程外服务2.0似乎不再支持ElasticSearch。我通过回滚到1.1版解决了这个问题。Ohlando,elasticsearchSink配置元素似乎不再受到直接支持(在2.0中)。但是,您可以从git下载代码,elasticsearch dll(Microsoft.Practices.EnterpriseLibrary.SemanticBlocking.elasticsearch.dll)仍在项目中。如果添加customSink属性,则可以使其正常工作。以下是我如何让它工作的:
<customSink type=" Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.ElasticsearchSink,Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Elasticsearch"
name="ElasticSearchOutput">
<sources>
<eventSource name="EventName" level="LogAlways"/>
</sources>
<parameters>
<parameter name="instanceName" type="System.String" value="instance" />
<parameter name="connectionString" type="System.String" value="http://localhost:9200" />
<parameter name="index" type="System.String" value="indexWithoutTheMinus" />
<parameter name="type" type="System.String" value="TypeHere" />
<parameter name="flattenPayload" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]" value="false" />
<parameter name="bufferInterval" type="System.TimeSpan" value="00:00:01" />
<parameter name="bufferingCount" type="System.Int32" value="1" />
<parameter name="maxBufferSize" type="System.Int32" value="500" />
<parameter name="onCompletedTimeout" type="System.TimeSpan" value="00:00:10" />
这在v2中对我有效!不过,我在任何文档中都找不到这个。我还想知道SLAB团队中是否有人读过这篇文章,并且可以评论是否有办法将速记配置添加回二进制文件中?我已经下载并浏览了代码,但我还没有找到发生这种情况的地方
谢谢
斯科特这就是我一直在寻找的答案!非常感谢。顺便说一句,Elasticsearch sink的当前版本非常感谢,mort。我刚刚在一个新项目中加入了SLAB,注意到它下载的ES Nuget包,然后在我的SO配置文件中发现了这一点。伙计,努吉真是太好了:)
<customSink type=" Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Sinks.ElasticsearchSink,Microsoft.Practices.EnterpriseLibrary.SemanticLogging.Elasticsearch"
name="ElasticSearchOutput">
<sources>
<eventSource name="EventName" level="LogAlways"/>
</sources>
<parameters>
<parameter name="instanceName" type="System.String" value="instance" />
<parameter name="connectionString" type="System.String" value="http://localhost:9200" />
<parameter name="index" type="System.String" value="indexWithoutTheMinus" />
<parameter name="type" type="System.String" value="TypeHere" />
<parameter name="flattenPayload" type="System.Nullable`1[[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]" value="false" />
<parameter name="bufferInterval" type="System.TimeSpan" value="00:00:01" />
<parameter name="bufferingCount" type="System.Int32" value="1" />
<parameter name="maxBufferSize" type="System.Int32" value="500" />
<parameter name="onCompletedTimeout" type="System.TimeSpan" value="00:00:10" />