title: Semantic Logging with Enterprise Library 6 out-of-process
body: <p>I've migrated to Enterprise Library 6 with semantic logging. It works fine with in process logging, but I could not get out-of-process logging working. SemanticLogging SVC is started as Windows Service, and I know it's working fine because I could not delete the logfile configured due to error 'File in use by Semantic-SVC Service'. Additionally it recreates a new file if I change the filename in SemanticLogging-svc.xml. But the logfile is just empty.
  I'm using the examples from <a href="https://msdn.microsoft.com/en-us/library/dn440729%28v=pandp.60%29.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/dn440729%28v=pandp.60%29.aspx</a> . I call MyCompanyEvents.Log.Startup. MatchAnyKeyword is set to 12, Level is 'always' so it should log the Startup message.
  Any ideas?</p>
  
  <hr>
  
  <pre><code>[EventSource(Name = "MyCompany")]
  public class MyCompanyEventSource : EventSource
  {
  public class Keywords
  {
      public const EventKeywords Page = (EventKeywords)1;
      public const EventKeywords DataBase = (EventKeywords)2;
      public const EventKeywords Diagnostic = (EventKeywords)4;
      public const EventKeywords Perf = (EventKeywords)8;
  }
  
  public class Tasks
  {
      public const EventTask Page = (EventTask)1;
      public const EventTask DBQuery = (EventTask)2;
  }
  
  private static MyCompanyEventSource _log = new MyCompanyEventSource();
  private MyCompanyEventSource() { }
  public static MyCompanyEventSource Log { get { return _log; } }
  
  [Event(1, Message = "Application Failure: {0}", 
  Level = EventLevel.Critical, Keywords = Keywords.Diagnostic)]
  internal void Failure(string message)
  {
    this.WriteEvent(1, message);
  }
  
  [Event(2, Message = "Starting up.", Keywords = Keywords.Perf,
  Level = EventLevel.Informational)]
  internal void Startup()
  {
    this.WriteEvent(2);
  }
  
  [Event(3, Message = "loading page {1} activityID={0}",
  Opcode = EventOpcode.Start,
  Task = Tasks.Page, Keywords = Keywords.Page,
  Level = EventLevel.Informational)]
  internal void PageStart(int ID, string url)
  {
    if (this.IsEnabled()) this.WriteEvent(3, ID, url);
  }
  
  
  ...
  }
  
  
  
  &lt;?xml version="1.0"?&gt;
  &lt;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"&gt;
  &lt;!-- Optional settings for this host --&gt;
  &lt;traceEventService/&gt;
  &lt;!-- Event sink definitions used by this host to
  listen ETW events emitted by these EventSource instances --&gt;
  &lt;sinks&gt;
  &lt;consoleSink name="ConsoleEventSink"&gt;
    &lt;sources&gt;
      &lt;eventSource name="MyCompany" level="LogAlways" matchAnyKeyword="12"/&gt;
    &lt;/sources&gt;
    &lt;eventTextFormatter header="+=========================================+"/&gt;
  &lt;/consoleSink&gt;
  
  &lt;rollingFlatFileSink name="RollingFlatFileSink" 
                       fileName="c:\\logs\\RollingFlatFile.log" 
                       timeStampPattern="yyyy" 
                       rollFileExistsBehavior="Overwrite" 
                       rollInterval="Day"&gt;
    &lt;sources&gt;
      &lt;eventSource name="MyCompany"
                   level="LogAlways" matchAnyKeyword="12"/&gt;
    &lt;/sources&gt;
  &lt;/rollingFlatFileSink&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>