<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright (c) 2012-2021 Red Hat, Inc.
    This program and the accompanying materials are made
    available under the terms of the Eclipse Public License 2.0
    which is available at https://www.eclipse.org/legal/epl-2.0/

    SPDX-License-Identifier: EPL-2.0

    Contributors:
      Red Hat, Inc. - initial API and implementation

-->
<configuration>

    <property name="max.retention.days" value="60" />

    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.access.PatternLayoutEncoder">
            <pattern>common</pattern>
        </encoder>
    </appender>

    <appender name="ACCESS-LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${che.logs.dir}/logs/localhost-access.log</file>
        <append>true</append>
        <encoder class="ch.qos.logback.access.PatternLayoutEncoder">
            <charset>utf-8</charset>
            <pattern>common</pattern>
        </encoder>
        <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
            <fileNamePattern>${che.logs.dir}/archive/localhost-access-%d{yyyyMMdd}-%i.log</fileNamePattern>
            <maxHistory>${max.retention.days}</maxHistory>
            <maxFileSize>20MB</maxFileSize>
        </rollingPolicy>
    </appender>

    <appender-ref ref="ACCESS-LOG" />

</configuration>
