[ 
https://issues.apache.org/jira/browse/LOG4J2-904?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14980647#comment-14980647
 ] 

Remko Popma edited comment on LOG4J2-904 at 11/29/15 2:44 AM:
--------------------------------------------------------------

Current configuration file:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status = "warn" name = "MyApp" packages = "">
    <Appenders>
        <RollingRandomAccessFile name = "RollingRandomAccessFile" fileName = 
"f:/Log4J/logs/RollingIIB.log" filePattern = 
"f:/Log4J/logs/$${date:yyyy-MM}/RollingIIB-%d{MM-dd-yyyy}-%i.log.zip">
            <PatternLayout>
                <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
            </PatternLayout>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <TimeBasedTriggeringPolicy interval = "4"/>
                <SizeBasedTriggeringPolicy size = "250 MB"/>
            </Policies>
        </RollingRandomAccessFile>
    </Appenders>
    <Loggers>
        <Root level = "error">
            <AppenderRef ref = "RollingRandomAccessFile"/>
        </Root>
    </Loggers>
</Configuration>
{code}



was (Author: saw):
Current configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status = "warn" name = "MyApp" packages = "">
    <Appenders>
        <RollingRandomAccessFile name = "RollingRandomAccessFile" fileName = 
"f:/Log4J/logs/RollingIIB.log" filePattern = 
"f:/Log4J/logs/$${date:yyyy-MM}/RollingIIB-%d{MM-dd-yyyy}-%i.log.zip">
            <PatternLayout>
                <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
            </PatternLayout>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <TimeBasedTriggeringPolicy interval = "4"/>
                <SizeBasedTriggeringPolicy size = "250 MB"/>
            </Policies>
        </RollingRandomAccessFile>
    </Appenders>
    <Loggers>
        <Root level = "error">
            <AppenderRef ref = "RollingRandomAccessFile"/>
        </Root>
    </Loggers>
</Configuration>


> RollingFile appender doesn't zip and create new files
> -----------------------------------------------------
>
>                 Key: LOG4J2-904
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-904
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 2.1
>         Environment: Windows 7
>            Reporter: Stephen A. Weinfield
>
> Using TimeBasedTriggeringPolicy, with a filePattern of 
> {{f:/Log4J/$$\{date:yyyy-MM}/IIB-%d\{MM-dd-yyyy}-%i.log.zip}} and a fileName 
> of f:/Log4J/IIB.log:
> on date change, directory is created but filename is not zipped. Also old 
> file is not cleared out, but just appended to.
> Log4j2.xml:
> {code}
> <Configuration status = "warn" name = "Log4j2_Configuration" monitorInterval 
> = "60" packages = "">
>     <Appenders>
>         <RollingFile name = "RollingFile" fileName = "f:/Log4J/IIB.log" 
> filePattern = "f:/Log4J/$${date:yyyy-MM}/IIB-%d{MM-dd-yyyy}-%i.log.zip" >
>             <PatternLayout>
>                 <Pattern>%d %p %c{1} %m%n%n</Pattern>
>             </PatternLayout>
>             <Policies>
>                 <TimeBasedTriggeringPolicy interval = "1" modulate = "true"/>
>             </Policies>
>             <DefaultRolloverStrategy fileIndex = "min" max = "7" 
> compressionLevel = "5"/>
>         </RollingFile>
>     </Appenders>
>     <Loggers>
>         <Root level = "trace">
>             <AppenderRef ref = "RollingFile" level = "warn"/>
>         </Root>
>     </Loggers>
> </Configuration>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to