<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" monitorInterval="30">
    <Properties>
        <Property name="pattern">%-d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%t][%c{1}] %m%n</Property>
    </Properties>
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout pattern="${pattern}" />
        </Console>
        <RollingFile name="File" 
            fileName="${log.dir}/log-${sys:http.port}.log"
            filePattern="${log.dir}/$${date:yyyy-MM}/log-${sys:http.port}-%d{yyyy-MM-dd}-%i.log.gz">
            <PatternLayout pattern="${pattern}" />
            <Policies>
                <TimeBasedTriggeringPolicy />
                <SizeBasedTriggeringPolicy size="16 MB" />
            </Policies>
            <DefaultRolloverStrategy max="32" />
        </RollingFile>
        <SMTP name="Mail" 
              subject="${log.mail.subject}" 
              to="${log.mail.to}" 
              cc="${log.mail.cc}" 
              from="${log.mail.from}"
              smtpHost="${log.mail.host}" 
              smtpPort="${log.mail.port}"
              smtpUsername="${log.mail.user}" 
              smtpPassword="${log.mail.password}" 
              smtpDebug="false" 
              bufferSize="64">
        </SMTP>
        <!-- appender to send mails asynchronously -->
        <Async name="AsyncMail"> 
            <AppenderRef ref="Mail" />
        </Async>
        <Async name="AsyncFile"> 
            <AppenderRef ref="File" />
        </Async>
    </Appenders>
    <Loggers>
        <Logger name="org.springframework" level="INFO" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="org.mongodb.driver" level="WARN" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="org.apache" level="WARN" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqFiltersrv" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqNamesrv" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqBroker" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqClient" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqRemoting" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqTools" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqCommon" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqStore" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqStoreError" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqTransaction" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqRebalanceLock" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqStats" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Logger name="RocketmqAuthorize" level="ERROR" additivity="false">
            <AppenderRef ref="AsyncFile" />
        </Logger>
        <Root level="DEBUG" additivity="false">
            ${log.appender}
        </Root>
    </Loggers>
</Configuration>
