<?xml version="1.0"?>
<!-- 
 Licensed to the Apache Software Foundation (ASF) under one   
 or more contributor license agreements.  See the NOTICE file 
 distributed with this work for additional information        
 regarding copyright ownership.  The ASF licenses this file   
 to you 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.  
-->
<server>

  <!-- Overrides the default behaviour of phoenix that use "." as dir --> 
  <!-- and /SAR-INF/lib/*.jar as include resulting in a full scan -->
  <!-- of the james folder and very slow startup when there are a lot of -->
  <!-- messages in var -->
  <!-- -->
  <classloaders default="default" version="1.0">
    <classloader name="default" parent="*system*">
      <entry location="./SAR-INF/classes" />
      <fileset dir="./SAR-INF/lib">
        <include name="*.jar" />
      </fileset>
    </classloader>
    <predefined name="*system*" />
  </classloaders>

  <logs version="1.1">
    <!-- see http://jakarta.apache.org/avalon/excalibur/logger/index.html -->
    <factories>
      <factory type="file" class="org.apache.avalon.excalibur.logger.factory.FileTargetFactory"/>
    </factories>

    <!-- Logger categories -->
    <!-- -->
    <!-- The categories element contains zero or more category elements. -->
    <!-- -->
    <!-- Each category element has a name attribute that should be unique -->
    <!-- among the category elements. It also has a log-level attribute. -->
    <!-- This attribute can be set to any of the values FATALERROR, ERROR, -->
    <!-- WARN, INFO, or DEBUG.  This value determines what log messages -->
    <!-- are recorded in the log file.  In addition, each category element -->
    <!-- can have zero or more category subelements. -->
    <!-- -->
    <!-- Each category element has a single log-target sub-element.  Each of -->
    <!-- these elements has an id-ref attribute that must match the id attribute -->
    <!-- of a file subelement of the targets element that can be found in this -->
    <!-- file. -->
    <!-- -->
    <!-- In addition, each category element can have zero or more category subelements. -->
    <!-- -->
    <categories>
      <category name="" log-level="INFO">
        <log-target id-ref="default"/>
      </category>
      <category name="James.Mailet" log-level="INFO">
        <log-target id-ref="James-Mailet-target"/>
      </category>
      <category name="James" log-level="INFO">
        <log-target id-ref="James-target"/>
      </category>
      <category name="spoolmanager" log-level="INFO">
        <log-target id-ref="spoolmanager-target"/>
      </category>
      <category name="dnsserver" log-level="INFO">
        <log-target id-ref="dnsserver-target"/>
      </category>
      <category name="remotemanager" log-level="INFO">
        <log-target id-ref="remotemanager-target"/>
      </category>
      <category name="pop3server" log-level="INFO">
        <log-target id-ref="pop3server-target"/>
      </category>
      <category name="smtpserver" log-level="INFO">
        <log-target id-ref="smtpserver-target"/>
      </category>
      <category name="nntpserver" log-level="INFO">
        <log-target id-ref="nntpserver-target"/>
      </category>
      <category name="nntp-repository" log-level="INFO">
        <log-target id-ref="nntp-repository-target"/>
      </category>
      <category name="mailstore" log-level="INFO">
        <log-target id-ref="mailstore-target"/>
      </category>
      <category name="users-store" log-level="INFO">
        <log-target id-ref="users-store-target"/>
      </category>
      <category name="objectstorage" log-level="INFO">
        <log-target id-ref="objectstorage-target"/>
      </category>
      <category name="connections" log-level="INFO">
        <log-target id-ref="connections-target"/>
      </category>
      <category name="sockets" log-level="INFO">
        <log-target id-ref="sockets-target"/>
      </category>
      <category name="scheduler" log-level="INFO">
        <log-target id-ref="scheduler-target"/>
      </category>
      <category name="fetchmail" log-level="INFO">
        <log-target id-ref="fetchmail-target"/>
      </category>
    </categories>

    <!-- Logger targets -->
    <!-- -->
    <!-- The targets element contains zero or more file elements. -->
    <!-- -->
    <!-- Each file element has an id attribute that should be unique -->
    <!-- among the file elements.  -->
    <!-- -->
    <!-- Each file element has three sub-elements.  The filename element -->
    <!-- specifies the file associated with this log target.   The format -->
    <!-- element describes the format for each line in the log.  The append -->
    <!-- element is a boolean value that determines whether James appends -->
    <!-- to old logs on restart.  -->
    <!-- -->
    <targets>
      <file id="default">
        <filename>${app.home}/logs/default</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="James-Mailet-target">
        <filename>${app.home}/logs/mailet</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="James-target">
        <filename>${app.home}/logs/james</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="spoolmanager-target">
        <filename>${app.home}/logs/spoolmanager</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="dnsserver-target">
        <filename>${app.home}/logs/dnsserver</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="remotemanager-target">
        <filename>${app.home}/logs/remotemanager</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="pop3server-target">
        <filename>${app.home}/logs/pop3server</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="smtpserver-target">
        <filename>${app.home}/logs/smtpserver</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="nntpserver-target">
        <filename>${app.home}/logs/nntpserver</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="nntp-repository-target">
        <filename>${app.home}/logs/nntpstore</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="mailstore-target">
        <filename>${app.home}/logs/mailstore</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="users-store-target">
        <filename>${app.home}/logs/usersstore</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="objectstorage-target">
        <filename>${app.home}/logs/objectstore</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="connections-target">
        <filename>${app.home}/logs/connections</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="sockets-target">
        <filename>${app.home}/logs/sockets</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="scheduler-target">
        <filename>${app.home}/logs/scheduler</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
      <file id="fetchmail-target">
        <filename>${app.home}/logs/fetchmail</filename>
        <format>%{time:dd/MM/yy HH:mm:ss} %5.5{priority} %{category}: %{message}\n%{throwable}</format>
        <append>true</append>
        <rotation type="unique" pattern="-yyyy-MM-dd-HH-mm" suffix=".log">
          <or>
            <date>dd</date>
            <size>10485760</size>
          </or>
        </rotation>
      </file>
    </targets>
  </logs>
</server>
