<?xml version="1.0" encoding="UTF-8" ?>
<configuration status="INFO">
    <!--全局参数-->
    <Properties>
        <Property name="pattern">%d{yyyy-MM-dd HH:mm:ss,SSS} [%thread]  |-%-5level   %c{1}:%L - %m%n</Property>
        <property name="LOG_HOME">/home/tomcat/log/fcb-project-manager/</property>
        <property name="REQUEST_FILE_NAME">request</property>
        <property name="INFO_FILE_NAME">log_info</property>
    </Properties>
    <Appenders>
        <Console name="Console" target="SYSTEM_OUT">
            <PatternLayout>
                <pattern>
                    ${pattern}
                </pattern>
            </PatternLayout>
        </Console>

        <RollingFile  name="info-log"
                                 fileName="${LOG_HOME}/${INFO_FILE_NAME}.log"
                                 filePattern="${LOG_HOME}/$${date:yyyy-MM}/${INFO_FILE_NAME}-%d{yyyy-MM-dd}-%i.log">
            <PatternLayout>
                <pattern>
                    ${pattern}
                </pattern>
            </PatternLayout>
            <Policies>
                <TimeBasedTriggeringPolicy modulate="true" interval="1"/>
                <SizeBasedTriggeringPolicy size="200 MB"/>
            </Policies>
            <DefaultRolloverStrategy max="200"/>
        </RollingFile >

        <RollingRandomAccessFile name="request-log"
                                 fileName="${LOG_HOME}/${REQUEST_FILE_NAME}.log"
                                 filePattern="${LOG_HOME}/$${date:yyyy-MM}/${REQUEST_FILE_NAME}-%d{yyyy-MM-dd}-%i.log">
            <PatternLayout
                    pattern="%date{yyyy-MM-dd HH:mm:ss.SSS} %level [%thread][%file:%line] - %msg%n"/>
            <Policies>
                <TimeBasedTriggeringPolicy/>
                <SizeBasedTriggeringPolicy size="200 MB"/>
            </Policies>
            <DefaultRolloverStrategy max="200"/>
        </RollingRandomAccessFile>
    </Appenders>

    <Loggers>
        <Root level="info">
            <AppenderRef ref="info-log" />
            <AppenderRef ref="Console" />
        </Root>
        <Logger name="request" level="info"
                additivity="false">
            <AppenderRef ref="request-log"/>
        </Logger>
        <Logger name="org.springframework">
            <AppenderRef ref="Console" />
        </Logger>
    </Loggers>
</configuration>