<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info">

    <Properties>
        <Property name="log-path">${sys:user.home}/demobench</Property>
        <Property name="log-name">demobench</Property>
        <Property name="archive">${sys:log-path}/archive</Property>
        <Property name="consoleLogLevel">error</Property>
        <Property name="defaultLogLevel">info</Property>
    </Properties>

    <ThresholdFilter level="trace"/>

    <Appenders>
        <!-- Will generate up to 10 log files for a given day. During every rollover it will delete
             those that are older than 60 days, but keep the most recent 10 GB -->
        <RollingFile name="RollingFile-Appender"
                     fileName="${sys:log-path}/${log-name}.log"
                     filePattern="${archive}/${log-name}.%date{yyyy-MM-dd}-%i.log.gz">

            <PatternLayout pattern="%date{ISO8601}{UTC}Z [%-5level] %c{1} - %msg%n"/>

            <Policies>
                <TimeBasedTriggeringPolicy/>
                <SizeBasedTriggeringPolicy size="10MB"/>
            </Policies>

            <DefaultRolloverStrategy min="1" max="10">
                <Delete basePath="${archive}" maxDepth="1">
                    <IfFileName glob="${log-name}*.log.gz"/>
                    <IfLastModified age="60d">
                        <IfAny>
                            <IfAccumulatedFileSize exceeds="10 GB"/>
                        </IfAny>
                    </IfLastModified>
                </Delete>
            </DefaultRolloverStrategy>

        </RollingFile>
    </Appenders>

    <Loggers>
        <Root level="${sys:defaultLogLevel}">
            <AppenderRef ref="RollingFile-Appender"/>
        </Root>
    </Loggers>
</Configuration>
