Newer
Older
Twilight / src / main / resources / log4j2.xml
<?xml version="1.0" encoding="UTF-8"?>
<Configuration packages="net.taehui.twilight.system">
    <Appenders>
        <Window name="Window">
            <PatternLayout disableAnsi="false" pattern="%highlight{[%p]} [%d{yyyy-MM-dd a hh:mm:ss}] %m%n"/>
        </Window>

        <RollingRandomAccessFile name="Twilight" fileName="${sys:user.dir}/Event/Twilight/Twilight.log"
                                 filePattern="${sys:user.dir}/Event/Twilight/%d{yyyy-MM-dd}.log.gz">
            <PatternLayout pattern="[%p] [%d{yyyy-MM-dd a hh:mm:ss}] %m%n"/>
            <TimeBasedTriggeringPolicy/>
        </RollingRandomAccessFile>

        <RollingRandomAccessFile name="Site" fileName="${sys:user.dir}/Event/Site/Site.log"
                                 filePattern="${sys:user.dir}/Event/Site/%d{yyyy-MM-dd}.log.gz">
            <PatternLayout pattern="[%p] [%d{yyyy-MM-dd a hh:mm:ss}] %m%n"/>
            <TimeBasedTriggeringPolicy/>
        </RollingRandomAccessFile>

        <RollingRandomAccessFile name="Www" fileName="${sys:user.dir}/Event/Www/Www.log" filePattern="${sys:user.dir}/Event/Www/%d{yyyy-MM-dd}.log.gz">
            <PatternLayout pattern="[%p] [%d{yyyy-MM-dd a hh:mm:ss}] %m%n"/>
            <TimeBasedTriggeringPolicy/>
        </RollingRandomAccessFile>

        <RollingRandomAccessFile name="Fault" fileName="${sys:user.dir}/Event/Fault/Fault.log"
                                 filePattern="${sys:user.dir}/Event/Fault/%d{yyyy-MM-dd}.log.gz">
            <PatternLayout pattern="[%p] [%d{yyyy-MM-dd a hh:mm:ss}] %m%n"/>
            <TimeBasedTriggeringPolicy/>
        </RollingRandomAccessFile>
    </Appenders>

    <Loggers>
        <AsyncLogger name="net.taehui.twilight.Site" additivity="false">
            <AppenderRef ref="Window"/>
            <AppenderRef ref="Site"/>
        </AsyncLogger>

        <AsyncLogger name="net.taehui.twilight.system.IO" additivity="false">
            <AppenderRef ref="Window"/>
        </AsyncLogger>

        <AsyncLogger name="net.taehui.twilight.taehui.TaehuiAvatar" additivity="false">
            <AppenderRef ref="Window"/>
            <AppenderRef ref="Www"/>
        </AsyncLogger>

        <AsyncLogger name="net.taehui.twilight.www.WwwAvatar" additivity="false">
            <AppenderRef ref="Window"/>
            <AppenderRef ref="Www"/>
        </AsyncLogger>

        <AsyncLogger name="net.taehui.twilight.QwilightLogging" additivity="false">
            <AppenderRef ref="Window"/>
            <AppenderRef ref="Fault"/>
        </AsyncLogger>

        <AsyncRoot level="info">
            <AppenderRef ref="Window"/>
            <AppenderRef ref="Twilight" level="info"/>
            <AppenderRef ref="Fault" level="error"/>
        </AsyncRoot>
    </Loggers>
</Configuration>