Overview

Dedicated logging for Arrow can be enabled for troubleshooting. 

Background

Arrow uses log4net for this purpose.  This article will give an example of how to enable detailed logging using log4net.  For complete log4net configuration documentation, see the Apache log4net website.

Logging for Non-Scheduler Components

The non-scheduler components include the web parts, custom actions for documents, and URL reports.  To enable logging for these components, you will need to add log4net configuration information to the web.config for the site collection.

Add the log4net section declaration to configSections:

<configSections>
  <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>

Then add the log4net section:

<log4net>
  <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
    <!-- This is where your log is saved; choose a location with appropriate permissions -->
    <param name="File" value="C:\arrowlog.txt" />
    <appendToFile value="true" />
    <rollingStyle value="Date" />
    <datePattern value=".yyyy-MM-dd" />
    <layout type="log4net.Layout.PatternLayout">
      <param name="ConversionPattern" value="%d [%t] ac.server %-5p %c - %m%n" />
    </layout>
  </appender>
  <root>
    <level value="DEBUG" />
    <appender-ref ref="RollingFileAppender" />
  </root>
</log4net>

 The appender is what actually writes logging requests to a logging destination.  The appender is the place where you specify the log location and the log format, among other settings.

 The root element defines settings for the root logger.  This is where you set the level/detail of log requests (e.g., DEBUG, INFO, etc.).  Each appender must be added to the root logger in order for it to write log requests to that appender's destination.

Logging for the Scheduler Service

To enable logging for the scheduler service, locate the WRScheduleService.exe.config file, which is stored in the Arrow install directory by default (e.g., C:\Program Files\Windward Studios\Windward Reports Arrow).

The same XML elements used in the non-scheduler components are added to the WRScheduleService.exe.config file.  The only difference is what settings you choose.  Below is an example of logging to the event log, WRSchedSvcLog.

 <?xml version="1.0" encoding="utf-8"?>

<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net, Culture=neutral, Version=1.2.10.0, PublicKeyToken=1b44e1d426115821" />
  </configSections>
  <log4net>
    <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender">
      <!-- This is where your log is saved -->
      <applicationName value="WRScheduleService" />
      <logName value="WRSchedSvcLog" />
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] ac.server %-5p %c - %m%n" />
      </layout>
    </appender>
    <root>
      <level value="DEBUG" />
      <appender-ref ref="EventLogAppender" />
    </root>
  </log4net>
  <appSettings>
    <add key="ArrowLicense" value=""/>
  </appSettings>
  <connectionStrings>
    <add name="Arrow"
         connectionString="Server=localhost;Database=Arrow;User ID=app_arrow_sql;Password=Server2008"
         providerName="System.Data.SqlClient"/>
  </connectionStrings>
</configuration>

Last edited Jun 18, 2012 at 3:52 PM by allisonl, version 3

Comments

No comments yet.