我正在尝试使用 ETW/Out-Of-Process 日志记录正确配置 ElasticSearch。我已成功安装最新版本的进程外记录器,并按照 SLAB网站上列出的步骤进行操作。
我的SemanticLogging-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>
但是,当我尝试启动服务时,我收到以下错误消息:
c:\slab-svc2\tools>SemanticLogging-svc.exe -c
Enterprise Library Semantic Logging Service v2.0.1406.1
Microsoft Enterprise Library
Microsoft Corporation
One or more errors occurred when loading the TraceEventService configuration file.
Configuration file: C:\Tools\slab-svc2\tools\SemanticLogging-svc.xml
The element 'sinks' has invalid child element 'elasticsearchSink'. List of possible elements expecte
d: 'flatFileSink, rollingFlatFileSink, windowsAzureTableSink, sqlDatabaseSink, consoleSink, customSi
nk' as well as any element in namespace '##other'.
Line number: 11, Line position: 7
我还应该注意,我已经下载了FullScale180.SemanticLogging.Elasticsearch
nuget 包并将其放在与可执行文件相同的目录中。我看到一篇含糊的博客文章说,SLAB 的 ElasticSearch 组件现在是一个社区项目,它为我指明了这个方向。但是如何配置它以使用进程外服务?
谢谢。