This content is archived. See latest version here.

Last updated: Jun 10 2014

Introduction

This document describes logging for an integration of EPiServer Find with EPiServer 7/7.5 CMS. To investigate and resolve issues it is always good to turn on logging for your application. Find logs with log4net as it is the default logging framework in EPiServer.

Activating logging

To activate logging, add an appender and a logger in the EPiServerLog.config, located by default in the web root of your EPiServer application, for the EPiServer Find namespace.

C#
<appender name="FindRollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
   <file value="find.log" />
   <appendToFile value="true" />
   <datePattern value=".yyyyMMdd.'log'" />
   <rollingStyle value="Date" />
   <filter type="log4net.Filter.LevelRangeFilter">
      <acceptOnMatch value="true" />
      <levelMin value="INFO" />
      <levelMax value="FATAL" />
   </filter>
   <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date %level [%thread] %type.%method - %message%n" />
   </layout>
</appender>
<logger name="EPiServer.Find">
   <appender-ref ref="FindRollingLogFileAppender" />
</logger>

If your application does not have an EPiServerLog.config, then create one in the web root folder of your application and add the logger and appender there.

C#
 <?xml version="1.0" encoding="utf-8"?>
<log4net>
<appender name="FindRollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
   <file value="find.log" />
   <appendToFile value="true" />
   <datePattern value=".yyyyMMdd.'log'" />
   <rollingStyle value="Date" />
   <filter type="log4net.Filter.LevelRangeFilter">
      <acceptOnMatch value="true" />
      <levelMin value="INFO" />
      <levelMax value="FATAL" />
   </filter>
   <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date %level [%thread] %type.%method - %message%n" />
   </layout>
</appender>
<logger name="EPiServer.Find">
   <appender-ref ref="FindRollingLogFileAppender" />
</logger>
</log4net>

Comments