<configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] {%mdc} %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>log/deployit.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>log/deployit.%i.log</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>5</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>5MB</maxFileSize>
        </triggeringPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] {%mdc} %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="info">
        <appender-ref ref="STDOUT" />
        <appender-ref ref="FILE" />
    </root>

    <logger name="com.xebialabs" level="info" />
    <logger name="com.xebialabs.deployit.core.api.resteasy.http" level="info" />
    <logger name="com.xebialabs.deployit.jetty.HttpHeaderOverrideServletRequest" level="info" />
    <logger name="com.xebialabs.deployit.jetty.FlexRestCompatibilityServletRequest" level="info" />
    <logger name="com.xebialabs.overthere" level="info" />
    <logger name="net.schmizz.sshj" level="error" />
    <logger name="org.springframework" level="warn"/>
    <logger name="org.apache.jackrabbit" level="warn" />

    <!--  Audit logging -->
    
    <appender name="AUDIT" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>log/audit.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>log/audit.%d{yyyy-MM-dd}.log</FileNamePattern>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%logger{36}] %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="audit" level="info" additivity="false">
        <appender-ref ref="AUDIT" />
    </logger>

<!--
    Uncomment the configuration below to have Deployit log generated scripts to log/scripts.log:
-->
<!--
    <appender name="SCRIPTS" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>log/scripts.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
            <fileNamePattern>log/scripts.%i.log</fileNamePattern>
            <minIndex>1</minIndex>
            <maxIndex>5</maxIndex>
        </rollingPolicy>
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <maxFileSize>5MB</maxFileSize>
        </triggeringPolicy>
        <encoder>
            <pattern>%msg%n</pattern>
        </encoder>
    </appender>

    <logger name="com.xebialabs.deployit.plugin.generic.scripts" level="trace" additivity="false">
        <appender-ref ref="SCRIPTS" />
    </logger>

    <logger name="com.xebialabs.deployit.plugin.python.scripts" level="trace" additivity="false">
        <appender-ref ref="SCRIPTS" />
    </logger>

    <logger name="com.xebialabs.deployit.plugin.powershell.scripts" level="trace" additivity="false">
        <appender-ref ref="SCRIPTS" />
    </logger>
-->
  
</configuration>
