2013-02-19 60 views
1
i have following configuration file in log4j 2 


<RollingFile name="RollingFile" fileName="logs/test.log" 
     filePattern="logs$${date:yyyyMM}/app-%d{MM-dd-yyyy}.log"> 
        <PatternLayout pattern="%d %-5p [%t] %C{4} (%F:%L) - %m%n"/> 
        <Policies> 
         <OnStartupTriggeringPolicy /> 
         <SizeBasedTriggeringPolicy size="20 MB"/> 
        </Policies> 
        <DefaultRolloverStrategy fileIndex="max" max="100"/> 
       </RollingFile> 

我可以在filePattern中執行日期加法和/或減法。 ?截至目前,翻轉時生成的文件具有當前日期。我想從中減去一天。如何做呢 ?如何在log4j 2中添加/減去日期?

回答