<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
  <jmxConfigurator />

  <property name="layoutPattern" value="%p %d [%t - %X{deviceName} - %C{1}] %logger{36}.%M:%L - %m%n"/>

  <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
      <pattern>${layoutPattern}</pattern>
    </encoder>
  </appender>

  <logger name="org.jacorb" level="ERROR" />
  <logger name="org.tango" level="INFO" />

  <property name="logPath" value="${TANGO_JAVA_LOG_PATH:-/var/tmp/tango/java}"/>

  <appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
    <discriminator class="org.tango.logging.LoggingPerServerDiscriminator"/>
    <sift>
      <appender name="FILE-${serverName}" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${logPath}/${serverName}.log</file>
        <Append>true</Append>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
          <fileNamePattern>${logPath}/${serverName}-%i.log</fileNamePattern>
          <minIndex>1</minIndex>
          <maxIndex>3</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
          <MaxFileSize>10MB</MaxFileSize>
        </triggeringPolicy>
        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
          <layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>${layoutPattern}</pattern>
          </layout>
        </encoder>
      </appender>
    </sift>
  </appender>

  <root level="ERROR">
    <appender-ref ref="CONSOLE" />
    <appender-ref ref="SIFT" />
  </root>
</configuration>
