<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Artifactory is a binaries repository manager.
  ~ Copyright (C) 2012 JFrog Ltd.
  ~
  ~ Artifactory is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU Lesser General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ Artifactory is distributed in the hope that it will be useful,
  ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~ GNU Lesser General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Lesser General Public License
  ~ along with Artifactory.  If not, see <http://www.gnu.org/licenses/>.
  -->

<configuration debug="false">
    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <layout class="org.artifactory.logging.layout.BackTracePatternLayout">
            <pattern>%date [%thread] [%-5p] \(%-20c{3}:%L\) - %m%n</pattern>
        </layout>
    </appender>
    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${artifactory.home}/logs/artifactory.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <FileNamePattern>${artifactory.home}/logs/artifactory.%i.log.zip</FileNamePattern>
            <MinIndex>1</MinIndex>
            <MaxIndex>9</MaxIndex>
        </rollingPolicy>

        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <MaxFileSize>5MB</MaxFileSize>
        </triggeringPolicy>
        <layout class="org.artifactory.logging.layout.BackTracePatternLayout">
            <pattern>%date [%thread] [%-5p] \(%-20c{3}:%L\) - %m%n</pattern>
        </layout>
    </appender>
    <appender name="ACCESS" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${artifactory.home}/logs/access.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <FileNamePattern>${artifactory.home}/logs/access.%i.log.zip</FileNamePattern>
            <MinIndex>1</MinIndex>
            <MaxIndex>9</MaxIndex>
        </rollingPolicy>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%d %m%n</pattern>
        </layout>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <MaxFileSize>5MB</MaxFileSize>
        </triggeringPolicy>
    </appender>
    <appender name="IMPORT.EXPORT" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${artifactory.home}/logs/import.export.log</File>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%date [%-5level] \(%logger{32}:%line\) %message%n</pattern>
        </layout>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <FileNamePattern>${artifactory.home}/logs/import.export.%i.log.zip</FileNamePattern>
            <maxIndex>13</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <MaxFileSize>10MB</MaxFileSize>
        </triggeringPolicy>
    </appender>
    <appender name="TRAFFIC" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${artifactory.home}/logs/traffic</File>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%message%n</pattern>
        </layout>
        <rollingPolicy class="org.artifactory.traffic.policy.TrafficTimeBasedRollingPolicy">
            <FileNamePattern>${artifactory.home}/logs/traffic.%d{yyyyMMdd}</FileNamePattern>
        </rollingPolicy>
    </appender>
    <appender name="REQUEST" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <File>${artifactory.home}/logs/request.log</File>
        <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>%message%n</pattern>
        </layout>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <FileNamePattern>${artifactory.home}/logs/request.%i.log</FileNamePattern>
            <maxIndex>13</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <MaxFileSize>10MB</MaxFileSize>
        </triggeringPolicy>
    </appender>
    <root>
        <level value="WARN"/>
        <appender-ref ref="CONSOLE"/>
        <appender-ref ref="FILE"/>
    </root>
    <logger name="org.artifactory">
        <level value="INFO"/>
    </logger>
    <logger name="org.artifactory.security.AccessLogger" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="ACCESS"/>
    </logger>
    <logger name="org.artifactory.api.common.BasicStatusHolder" additivity="false">
        <level value="DEBUG"/>
        <appender-ref ref="IMPORT.EXPORT"/>
    </logger>
    <logger name="org.artifactory.traffic.TrafficLogger" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="TRAFFIC"/>
    </logger>
    <logger name="org.artifactory.traffic.RequestLogger" additivity="false">
        <level value="INFO"/>
        <appender-ref ref="REQUEST"/>
    </logger>

    <!-- third party loggers -->
    <logger name="org.apache.jackrabbit.core.query.lucene.MultiIndex">
        <level value="INFO"/>
    </logger>
    <logger name="org.apache.jackrabbit.core.persistence.pool.BundleDbPersistenceManager">
        <level value="INFO"/>
    </logger>
    <logger name="org.apache.jackrabbit.extractor.XMLTextExtractor">
        <level value="ERROR"/>
    </logger>
    <logger name="com.atlassian.crowd.integration.service.soap.client.ClientPropertiesImpl">
        <level value="WARN"/>
    </logger>

    <logger name="org.apache.wicket">
        <level value="ERROR"/>
    </logger>
    <logger name="org.apache.jackrabbit">
        <level value="WARN"/>
    </logger>
    <logger name="org.eclipse.jetty">
        <level value="INFO"/>
    </logger>
    <logger name="org.apache.commons.httpclient">
        <level value="INFO"/>
    </logger>
    <logger name="httpclient.wire">
        <level value="INFO"/>
    </logger>
    <logger name="org.springframework">
        <level value="WARN"/>
    </logger>

    <!--
    <logger name="org.artifactory.webapp.servlet.RepoFilter">
        <level value="DEBUG"/>
    </logger>
    <logger name="org.artifactory.jcr.lock.SessionLockEntry">
        <level value="TRACE"/>
    </logger>
    <logger name="org.artifactory.repo.jcr.JcrRepoBase">
        <level value="DEBUG"/>
    </logger>
    <logger name="org.artifactory.webapp.servlet.ArtifactoryResponseBase">
        <level value="DEBUG"/>
    </logger>
    -->
    <!--
    <logger name="org.artifactory.jcr.lock.InternalLockManager">
        <level value="TRACE"/>
    </logger>
    -->
</configuration>