EPiWiki.se  - EPiServer notes shared with others
 

LogService

[Edit]
Here is a more documented configuration file for the LogService functionality in EPiServer CMS.
Adding logging for the EPiServer LogService

EPiServerLog.config


The log4net has to be set up to send log messages over UDP (in the default configuration).

  <appender name="StatisticsUdpAppender" type="EPiServer.Diagnostics.EPiServerUdpAppender, EPiServer">
    <remoteAddress value="127.0.0.1" />
    <remotePort value="7071" />
  </appender>

All log messages generated by the logger “EPiServer.UI.Util.PixelImg” should be send to the Logservice.

  <!-- Statistics are sent to this logger, when enabled -->
  <logger name="EPiServer.UI.Util.PixelImg">
    <!-- Statistics are sent as 'Info' level logs, set the level to "Off" to disable statistics logging -->
    <level value="INFO" />
    <appender-ref ref="StatisticsUdpAppender" />
  </logger>

EPiServer.LogService.exe.config


The configuration of the LogService are located in the file
"%Programfiles%\EPiServer\Shared\Services\Log Service\EPiServer.LogService.exe.config"

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <!-- Microfoft WSE configuration -->
    <section
      name="microsoft.web.services3"
      type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    <!-- EPiServer Baselibrary configuration -->
    <section
      name="episerver.baseLibrary"
      allowDefinition="MachineToApplication"
      allowLocation="false"
      type="EPiServer.BaseLibrary.ConfigurationHandler,EPiServer.BaseLibrary" />
  </configSections>
  <!-- Microfoft WSE configuration -->
  <microsoft.web.services3>
    <messaging>
      <transports>
        <add scheme="soap.tcp" >
          <defaultPort value="8082" />
        </add>
      </transports>
    </messaging>
  </microsoft.web.services3>
  <episerver.baseLibrary>
    
    <classFactories>
      <!-- Register EPiServer class factory -->
      <add
        type="EPiServer.Implementation.DefaultBaseLibraryFactory, EPiServer.Implementation"
        id="DefaultBLF">
        <assignStatic type="EPiServer.BaseLibrary.ClassFactory"
                      property="Instance" />
      </add>
    </classFactories>
    <!-- Register a ObjectStore to store the data for the TimeSpanAnalyzer -->
    <objectStores>
    
      <add type="EPiServer.Implementation.SqlObjectStore, EPiServer.Implementation"
           id="default">
        <parameter name="connectionString"
                   value="Data Source=.\SQLEXPRESS;Database=EPiServerLocal;User Id=episerverlocal;Password=epi#server7local;Network Library=DBMSSOCN;" />
      </add>
    </objectStores>

    <channels>
      <!-- Register the sample analyzers as EPiServer channels-->
      <add type="EPiServer.Implementation.SynchronousChannel, EPiServer.Implementation"
           id="LogMessage">

        <!-- Register the FileAnalyzer to store a common log file for all
          episervers in a webb farm -->
        <sendListener
          type="EPiServer.Log.Analyzer.FileAnalyzer, EPiServer.Log.Analyzers"
          method="StoreMessage">
          <!-- The path to write log files to -->
          <EPsPath>c:\TEMP</EPsPath>
          <!-- Filename prefix used for log files -->
          <EPsFilename>FileAnalyzer</EPsFilename>
          <!--Gets or set whether the analyzer will flush at the end of
            each append operation.-->
          <EPfImmediateFlush>False</EPfImmediateFlush>
        </sendListener>

        <!-- Register the RealTimeAnalyzer to collect messages hold in the
          LogService memory-->
        <sendListener
          type="EPiServer.Log.Analyzer.RealTimeAnalyzer, EPiServer.Log.Analyzers"
          method="StoreMessage">
          <!-- The view for the analyzer -->
          <view
            type="EPiServer.Log.Analyzer.RealTimeAnalyzerView, EPiServer.Log.Analyzers"
            protocol="TCP/SOAP"
            endpoint="soap.tcp://localhost/RealTimeAnalyzerView"/>
          <!-- Maximum pages in the published pages queue -->
          <EPnPublishedPagesMaxCount>5</EPnPublishedPagesMaxCount>
        </sendListener>

        <!-- Register the sample analyzer TimeSpanAnalyzer to store
          - statistics with.
          -->
        <sendListener
          type="EPiServer.Log.Analyzer.TimeSpanAnalyzer, EPiServer.Log.Analyzers"
          method="StoreMessage">
          <!-- The view for the analyzer -->
          <view
            type="EPiServer.Log.Analyzer.TimeSpanAnalyzerView, EPiServer.Log.Analyzers"
            protocol="TCP/SOAP" />
          <!-- Interval to collect messages in
          - the interval is used as buckets.
          - Eg.
          - When 24 buckets of 5 minutes span is out of time
          - collect them all to the hour bucket.
          -->
          <EPnIntervalCountMinute>0</EPnIntervalCountMinute>
          <EPnIntervalCountMinute5>24</EPnIntervalCountMinute5>
          <EPnIntervalCountHour>24</EPnIntervalCountHour>
          <EPnIntervalCountDay>62</EPnIntervalCountDay>
          <EPnIntervalCountMonth>24</EPnIntervalCountMonth>
          <EPnIntervalCountYear>5</EPnIntervalCountYear>
        </sendListener>

      </add>
    </channels>

  </episerver.baseLibrary>

  <appSettings>
    <!-- The UDP channel the LogService is lisen for messages on-->
    <add key="udpClientPort" value="7071" />
  </appSettings>
</configuration>

How to remove EPiServer statistics from a web site


- Hide the statistics tab by uncheck "Statistics (EditPanel)" in "Plugin Manager" for "EPiServer User Interface" wich is located on the "Config" tab i EPiServers admin mode.
- Turn off the service "EPiServerLogService" from Windows services, and set start up type to "Manual"
- Disable the statistic logger
EPiServerLog.config

<logger name="EPiServer.UI.Util.PixelImg">
    <level value="Off" />
    <appender-ref ref="StatisticsUdpAppender" />
  </logger>

Version author:
Mattias Lövström

EPiServer version

All