<?xml version="1.0" encoding="utf-8"?><!--
  Copyright 1999-2004 The Apache Software Foundation

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<logkit>
  <factories>
    <factory class="org.apache.avalon.excalibur.logger.factory.PriorityFilterTargetFactory" type="priority-filter"/>
    <factory class="org.apache.avalon.excalibur.logger.factory.ServletTargetFactory" type="servlet"/>
    <factory class="org.apache.cocoon.util.log.CocoonTargetFactory" type="cocoon"/>
    <factory class="org.apache.avalon.excalibur.logger.factory.LF5TargetFactory" type="lf5"/>
  </factories>

  <targets>
  

    <!-- To enable the LogFactor5 graphical logkit browser, replace the cocoon factory 
         below with the following.
    <lf5 id="core"/>
    -->

    <cocoon id="core">
      <filename>${context-root}/WEB-INF/logs/core.log</filename>
      <format type="cocoon">
        %7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}
      </format>
  <!-- append=false: Will override existing log files on Cocoon startup
  append=true: Will append to the existing log files -->
      <append>false</append>
  <!-- rotation : allows you to rotate log files oncee they meet certain
  criteria. In example below, files are rotated once they
  are one hour old or bigger than 100 Mb.
  <rotation type="revolving" init="1" max="4">
   <or>
    <size>100m</size>
    <time>01:00:00</time>
   </or>
  </rotation>-->
    </cocoon>

    <cocoon id="sitemap">
      <filename>${context-root}/WEB-INF/logs/sitemap.log</filename>
      <format type="cocoon">
        %7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}
      </format>
      <append>false</append>
    </cocoon>

 <cocoon id="sdx">
  <filename>${context-root}/WEB-INF/logs/sdx.log</filename>
  <format type="cocoon">%7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}</format>
  <append>false</append>
 </cocoon>
 
 <priority-filter id="sdxError" log-level="ERROR">
  <cocoon>
   <filename>${context-root}/WEB-INF/logs/sdxError.log</filename>
   <format type="cocoon">%7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}</format>
   <append>false</append>
  </cocoon>
 </priority-filter>
 
 <cocoon id="oai">
  <filename>${context-root}/WEB-INF/logs/oai.log</filename>
  <format type="cocoon">%7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}</format>
  <append>false</append>
 </cocoon>
 
 <priority-filter id="oaiError" log-level="ERROR">
  <cocoon>
   <filename>${context-root}/WEB-INF/logs/oaiError.log</filename>
   <format type="cocoon">%7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}</format>
   <append>false</append>
  </cocoon>
 </priority-filter>

    <cocoon id="handled-errors">
      <filename>${context-root}/WEB-INF/logs/handled-errors.log</filename>
      <format type="cocoon">
        %7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}
      </format>
      <append>false</append>
    </cocoon>

    <cocoon id="access">
      <filename>${context-root}/WEB-INF/logs/access.log</filename>
      <format type="cocoon">
        %7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}
      </format>
      <append>false</append>
    </cocoon>

    <!-- The logger for the flow layer -->
    <cocoon id="flow">
      <filename>${context-root}/WEB-INF/logs/flow.log</filename>
      <format type="cocoon">
        %7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}
      </format>
      <append>false</append>
    </cocoon>

    <priority-filter id="error" log-level="ERROR">
      <cocoon>
        <filename>${context-root}/WEB-INF/logs/error.log</filename>
        <format type="cocoon">
          %7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}
        </format>
        <append>false</append>
      </cocoon>
    </priority-filter>
  
    <cocoon id="forms">
      <filename>${context-root}/WEB-INF/logs/forms.log</filename>
      <format type="cocoon">
        %7.7{priority} %{time}   [%{category}] (%{uri}) %{thread}/%{class:short}: %{message}\n%{throwable}
      </format>
      <append>false</append>
    </cocoon>

</targets>


  <categories>
    <!--
      log-level: One of DEBUG, INFO, WARN, ERROR, FATAL_ERROR.
      Log level could be different for every category and subcategory.

      Not all subcategories are defined in this file. Not defined
      subcategories will be created automatically inheriting settings
      of the parent subcategory.
      When defining subcategory manually, it is required to specify log
      targets, because they are not inherited in this case.
    -->
    
    <category log-level="INFO" name="core">
      <!-- Startup component manager logger -->
      <category log-level="INFO" name="startup">
        <log-target id-ref="core"/>
        <log-target id-ref="error"/>
      </category>

      <category log-level="INFO" name="roles">
        <log-target id-ref="core"/>
        <log-target id-ref="error"/>
      </category>

      <category log-level="INFO" name="instrument">
        <category log-level="INFO" name="values">
          <log-target id-ref="core"/>
          <log-target id-ref="error"/>
        </category>
        <log-target id-ref="core"/>
        <log-target id-ref="error"/>
      </category>

      <!-- Cocoon component manager logger -->
      <category log-level="INFO" name="manager">
        <log-target id-ref="core"/>
        <log-target id-ref="error"/>
      </category>

      <!-- Cocoon cache and stores logger -->
      <category log-level="INFO" name="store">
        <category log-level="INFO" name="janitor">
          <log-target id-ref="core"/>
          <log-target id-ref="error"/>
        </category>
        <log-target id-ref="core"/>
        <log-target id-ref="error"/>
      </category>

      <log-target id-ref="core"/>
      <log-target id-ref="error"/>
    </category>

    <category log-level="INFO" name="sitemap">
      <log-target id-ref="sitemap"/>
      <log-target id-ref="error"/>

      <category log-level="INFO" name="handled-errors">
        <!-- Exceptions that will be handled by a sitemap errorhandler are
             logged to this target. -->
        <log-target id-ref="handled-errors"/>
      </category>
    </category>

    <category log-level="INFO" name="access">
      <log-target id-ref="access"/>
      <log-target id-ref="error"/>
    </category>

    <category log-level="INFO" name="flow">
      <log-target id-ref="flow"/>
      <log-target id-ref="error"/>
    </category>

    <category log-level="ERROR" name="forms">
    	<log-target id-ref="forms"/>
      <log-target id-ref="error"/>
    </category>

        <!--sdx2 loglevel definitions-->
		<category name="sdx" log-level="ERROR">
            <category name="sdx.framework" log-level="ERROR"/>
            <category name="sdx.rdbms" log-level="ERROR"/>
			<log-target id-ref="sdx"/>
			<log-target id-ref="sdxError"/>
		</category>
		<!--sdx2 loglevel definitions-->


        <!--oai loglevel definitions-->
		<category name="oai" log-level="ERROR">
            <category name="oai" log-level="ERROR"/>
			<log-target id-ref="oai"/>
			<log-target id-ref="oaiError"/>
		</category>
		<!--oai loglevel definitions-->

    <category log-level="INFO" name="">
      <log-target id-ref="core"/>
      <log-target id-ref="error"/>
    </category>
  
	</categories>
</logkit>
