<configuration debug="false">
    <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"/>


    <define name="LOCAL_PROP_EXISTS" class="org.well.well.core.logback.ResourceExistsPropertyDefiner">
        <path>application.local.properties</path>
    </define>

    <define name="SERVER_PROP_EXISTS" class="org.well.well.core.logback.ResourceExistsPropertyDefiner">
        <path>application.server.properties</path>
    </define>

    <property resource="wellSensor/application.properties"/>

    <if condition="${LOCAL_PROP_EXISTS}">
        <then>
            <property resource="application.local.properties"/>
        </then>
    </if>

    <if condition="${SERVER_PROP_EXISTS}">
        <then>
            <property resource="application.server.properties"/>
        </then>
    </if>

    <jmxConfigurator/>

    <include resource="logback/console.xml"/>

    <if condition='${log.file.enable}'>
        <then>
            <include resource="logback/file.xml"/>
        </then>
    </if>

    <if condition='${log.mail.enable}'>
        <then>
            <include resource="logback/mail.xml"/>
        </then>
    </if>

    <if condition='${log.inspektr.enable}'>
        <then>
            <include resource="logback/inspektr.xml"/>
        </then>
    </if>

    <if condition='${log.log4jdbc.enable}'>
        <then>
            <include resource="logback/log4jdbc.xml"/>
        </then>
    </if>

    <root level="info">
        <appender-ref ref="CONSOLE"/>
        <if condition='${log.file.enable}'>
            <then>
                <appender-ref ref="FILE"/>
            </then>
        </if>
        <if condition='${log.mail.enable}'>
            <then>
                <appender-ref ref="MAIL"/>
            </then>
        </if>
    </root>

    <!--
        <logger name="net.sf.ehcache" level="debug"/>
        <logger name="org.hibernate.cache" level="debug"/>
    -->

    <logger name="org.well" level="info"/>
    <logger name="com.sun.jersey.core.spi.component.ProviderServices" level="warn"/>
    <logger name="com.sun.jersey.server.impl.cdi.CDIComponentProviderFactoryInitializer" level="warn"/>
    <logger name="com.sun.jersey.server.impl.ejb.EJBComponentProviderFactoryInitilizer" level="warn"/>
    <logger name="com.sun.jersey.server.impl.managedbeans.ManagedBeanComponentProviderFactoryInitilizer" level="warn"/>
    <logger name="org.hibernate.engine.internal.StatisticalLoggingSessionEventListener" level="warn"/>
    <logger name="org.hibernate.hql.internal.ast.HqlSqlWalker" level="error"/>
    <logger name="org.springframework.context.support.ResourceBundleMessageSource" level="error"/>
    <logger name="org.springframework.security.access.event.LoggerListener" level="error"/>
    <logger name="org.springframework.security.authentication.event.LoggerListener" level="error"/>
    <logger name="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" level="warn"/>


</configuration>
