<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<!-- # The five logging levels used by Log are (in order):
#
#   1. DEBUG (the least serious)
#   2. INFO
#   3. WARN
#   4. ERROR
#   5. FATAL (the most serious)
 -->

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

    <appender name="CORE" class="org.apache.log4j.RollingFileAppender">
        <!-- The active file to log to -->
        <param name="File" value="/sm-core.log"/>
        <param name="MaxFileSize" value="10000KB"/>
        <param name="Append" value="true"/>
        <param name="Encoding" value="UTF-8"/>
        <param name="Threshold" value="debug"/>
        <layout class="org.apache.log4j.PatternLayout">
            <!-- The log message pattern -->
            <param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} [%5p] (%F:%L) [%M] - %m%n"/>
        </layout>
    </appender>

    <logger name="com.salesmanager.core" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="CORE"/>
    </logger>

    <appender name="WEB" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="/sm-shop.log"/>
        <param name="Append" value="true"/>
        <param name="Encoding" value="UTF-8"/>
        <param name="Threshold" value="debug"/>

        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss} [%5p] (%F:%L) [%M] - %m%n"/>
        </layout>
    </appender>

    <logger name="com.salesmanager.web" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="WEB"/>
    </logger>

    <!-- 3rdparty Loggers -->
    <logger name="org.springframework.core">
        <level value="INFO" />
    </logger>

    <logger name="org.springframework.beans">
        <level value="INFO" />
    </logger>

    <logger name="org.springframework.context">
        <level value="INFO" />
    </logger>

    <logger name="org.springframework.web">
        <level value="INFO" />
    </logger>

    <logger name="org.hibernate">
        <level value="INFO"/>
    </logger>

    <logger name="org.apache.commons">
        <level value="INFO"/>
    </logger>

    <logger name="com.mysema">
        <level value="INFO"/>
    </logger>

    <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
        <param name="Target" value="System.out"/>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%p %c: %m%n"/>
        </layout>
    </appender>

    <root>
        <priority value="INFO"/>
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="WEB"/>
        <appender-ref ref="CORE"/>
    </root>

</log4j:configuration>