在log4j.xml中指定EST时区

时间:2018-12-14 18:12:44

标签: java log4j

我正在尝试在log4j.xml中设置EST时区。这是我的log4j.xml文件。任何建议都可以

    <?xml version="1.0" encoding="UTF-8"?>
<Configuration status="debug" xmlns:xi="http://www.w3.org/2001/XInclude" name="testApp">
    <Appenders>

    <RollingRandomAccessFile name="AppLogFile" fileName="${sys:myLogDir}/dcs.log" filePattern="${sys:myLogDir}/myApp-%d{yyyy-MM-dd}.log.gz">
            <PatternLayout>
                <Pattern>%d{ABSOLUTE} [%-10.10t] %-5p %-32.32c{2} %x- %msg%n</Pattern>
            </PatternLayout>
            <DefaultRolloverStrategy max="14"/>
            <Policies>
                <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
            </Policies>
    </RollingRandomAccessFile>   
    </Appenders> 
    <Loggers>
        <Root level="${sys:Log4jLevel}" additivity="false"> 
            <AppenderRef ref="Console" />
            <AppenderRef ref="AppLogFile" />
        </Root>
    </Loggers>

</Configuration>

0 个答案:

没有答案