<?xml version="1.0"?>
<configuration>
  <configSections>
    <sectionGroup name="common">
      <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging"/>
    </sectionGroup>
    <sectionGroup name="spring">
      <section name="context" type="Spring.Context.Support.WebContextHandler, Spring.Web"/>
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
    </sectionGroup>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
  </configSections>
  
  <common>
    <logging>
      <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net1211">
        <!-- choices are INLINE, FILE, FILE-WATCH, EXTERNAL -->
        <!-- otherwise BasicConfigurer.Configure is used -->
        <!-- log4net configuration file is specified with key configFile -->
        <arg key="configType" value="INLINE"/>
      </factoryAdapter>
    </logging>
  </common>
  
  <spring>
    
    <context>
      <resource uri="config://spring/objects"/>
      <resource uri="~/Config/webServices.xml"/>
      <resource uri="~/Config/webServices-aop.xml"/>
    </context>
    
    <objects xmlns="http://www.springframework.net">
      <description>Definitions of objects to be exported.</description>
      
      <!-- Aspect -->
      <object id="CommonLoggingAroundAdvice" type="Spring.Aspects.Logging.CommonLoggingAroundAdvice, Spring.Aspects">
        <property name="Level" value="Debug"/>
      </object>
      
      <!-- Service -->
      <object id="calculator" type="Spring.Calculator.Services.AdvancedCalculator, Spring.Calculator.Services"/>
      <object id="calculatorWeaved" type="Spring.Aop.Framework.ProxyFactoryObject, Spring.Aop">
        <property name="target" ref="calculator"/>
        <property name="interceptorNames">
          <list>
            <value>CommonLoggingAroundAdvice</value>
          </list>
        </property>
      </object>
    </objects>
    
  </spring>
  
  <system.web>
    <httpHandlers>
      <add verb="*" path="*.asmx" type="Spring.Web.Services.WebServiceHandlerFactory, Spring.Web"/>
    </httpHandlers>
    <httpModules>
      <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
    </httpModules>
    <compilation debug="true"/>
    <customErrors mode="RemoteOnly"/>
    <authentication mode="Windows"/>
    <authorization>
      <allow users="*"/>
    </authorization>
    <trace enabled="false" requestLimit="10" pageOutput="true" traceMode="SortByTime" localOnly="true"/>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
  </system.web>
  
  <log4net>
    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="Logs/log.txt"/>
      <appendToFile value="true"/>
      <rollingStyle value="Size"/>
      <maxSizeRollBackups value="10"/>
      <maximumFileSize value="100KB"/>
      <staticLogFileName value="true"/>
      <lockingModel type="log4net.Appender.RollingFileAppender+MinimalLock"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%-5level] %logger - %message%newline"/>
      </layout>
    </appender>
    <!-- Set default logging level -->
    <root>
      <level value="DEBUG"/>
      <appender-ref ref="RollingFileAppender"/>
    </root>
    <!-- Set logging for Spring.Aspects -->
    <logger name="Spring.Aspects">
      <level value="DEBUG"/>
    </logger>
    <!-- Set logging for Spring.Calculator -->
    <logger name="Spring.Calculator">
      <level value="DEBUG"/>
    </logger>
    <!-- Set logging for Spring -->
    <logger name="Spring">
      <level value="INFO"/>
    </logger>
  </log4net>
  
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
      <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
    </modules>
    <handlers>
      <add name="SpringPageHandlerFactory" verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
      <add name="SpringWebServiceHandlerFactory" verb="*" path="*.asmx" type="Spring.Web.Services.WebServiceHandlerFactory, Spring.Web"/>
      <add name="SpringContextMonitor" verb="*" path="ContextMonitor.ashx" type="Spring.Web.Support.ContextMonitor, Spring.Web"/>
    </handlers>
  </system.webServer>
</configuration>
