2

ETW/アウト プロセス ログで ElasticSearch を正しく構成しようとしています。Out-Of-Process ロガーの最新バージョンを正常にインストールし、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また、ナゲット パッケージをダウンロードし、実行可能ファイルと同じディレクトリに配置したことにも注意してください。SLAB の ElasticSearch コンポーネントは現在、その方向性を示すコミュニティ プロジェクトになっているというあいまいなブログ投稿に出くわしました。しかし、アウト オブ プロセス サービスで動作するようにこれを構成するにはどうすればよいでしょうか。

ありがとう。

4

2 に答える 2

1

誰かが興味を持っている場合に備えて.... SLAB Out-Of-Process Service 2.0 は ElasticSearch をサポートしていないようです。バージョン 1.1 にロールバックすることでこれを解決しました。

于 2015-02-20T21:53:04.773 に答える